puppet 4.10.9-x64-mingw32 → 4.10.10-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puppet might be problematic. Click here for more details.

Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/lib/puppet/agent.rb +22 -2
  3. data/lib/puppet/application.rb +18 -1
  4. data/lib/puppet/application/agent.rb +9 -2
  5. data/lib/puppet/application/apply.rb +1 -1
  6. data/lib/puppet/application/config.rb +1 -0
  7. data/lib/puppet/application/device.rb +1 -2
  8. data/lib/puppet/application/filebucket.rb +22 -5
  9. data/lib/puppet/application/help.rb +1 -0
  10. data/lib/puppet/application/inspect.rb +2 -0
  11. data/lib/puppet/application/lookup.rb +1 -3
  12. data/lib/puppet/application_support.rb +6 -1
  13. data/lib/puppet/defaults.rb +33 -4
  14. data/lib/puppet/face/config.rb +13 -0
  15. data/lib/puppet/functions/each.rb +10 -4
  16. data/lib/puppet/functions/lookup.rb +2 -2
  17. data/lib/puppet/functions/map.rb +12 -2
  18. data/lib/puppet/functions/reduce.rb +45 -2
  19. data/lib/puppet/interface.rb +1 -0
  20. data/lib/puppet/module_tool/tar/mini.rb +57 -4
  21. data/lib/puppet/network/http/factory.rb +9 -0
  22. data/lib/puppet/network/http/webrick.rb +1 -3
  23. data/lib/puppet/node.rb +10 -0
  24. data/lib/puppet/node/facts.rb +9 -0
  25. data/lib/puppet/parser/functions/sprintf.rb +17 -3
  26. data/lib/puppet/pops/loader/static_loader.rb +2 -2
  27. data/lib/puppet/pops/lookup/hiera_config.rb +2 -2
  28. data/lib/puppet/pops/merge_strategy.rb +16 -1
  29. data/lib/puppet/pops/types/iterable.rb +2 -0
  30. data/lib/puppet/pops/types/type_factory.rb +1 -1
  31. data/lib/puppet/pops/types/type_mismatch_describer.rb +15 -5
  32. data/lib/puppet/pops/types/types.rb +4 -2
  33. data/lib/puppet/provider/service/smf.rb +2 -2
  34. data/lib/puppet/provider/service/systemd.rb +1 -0
  35. data/lib/puppet/provider/service/upstart.rb +1 -1
  36. data/lib/puppet/settings/environment_conf.rb +10 -2
  37. data/lib/puppet/transaction.rb +3 -0
  38. data/lib/puppet/transaction/report.rb +8 -1
  39. data/lib/puppet/type.rb +1 -9
  40. data/lib/puppet/type/user.rb +9 -3
  41. data/lib/puppet/util/http_proxy.rb +14 -6
  42. data/lib/puppet/version.rb +1 -1
  43. data/locales/puppet.pot +29 -13
  44. data/man/man5/puppet.conf.5 +276 -55
  45. data/man/man8/extlookup2hiera.8 +2 -2
  46. data/man/man8/puppet-agent.8 +32 -10
  47. data/man/man8/puppet-apply.8 +21 -6
  48. data/man/man8/puppet-ca.8 +48 -34
  49. data/man/man8/puppet-catalog.8 +4 -4
  50. data/man/man8/puppet-cert.8 +23 -6
  51. data/man/man8/puppet-certificate.8 +44 -28
  52. data/man/man8/puppet-certificate_request.8 +4 -4
  53. data/man/man8/puppet-certificate_revocation_list.8 +4 -4
  54. data/man/man8/puppet-config.8 +5 -5
  55. data/man/man8/puppet-describe.8 +3 -3
  56. data/man/man8/puppet-device.8 +23 -13
  57. data/man/man8/puppet-doc.8 +5 -5
  58. data/man/man8/puppet-epp.8 +16 -10
  59. data/man/man8/puppet-facts.8 +4 -4
  60. data/man/man8/puppet-file.8 +4 -4
  61. data/man/man8/puppet-filebucket.8 +63 -6
  62. data/man/man8/puppet-generate.8 +84 -0
  63. data/man/man8/puppet-help.8 +4 -4
  64. data/man/man8/puppet-inspect.8 +8 -5
  65. data/man/man8/puppet-key.8 +4 -4
  66. data/man/man8/puppet-lookup.8 +87 -0
  67. data/man/man8/puppet-man.8 +5 -5
  68. data/man/man8/puppet-master.8 +5 -5
  69. data/man/man8/puppet-module.8 +22 -13
  70. data/man/man8/puppet-node.8 +4 -4
  71. data/man/man8/puppet-parser.8 +4 -4
  72. data/man/man8/puppet-plugin.8 +4 -4
  73. data/man/man8/puppet-report.8 +4 -4
  74. data/man/man8/puppet-resource.8 +4 -8
  75. data/man/man8/puppet-resource_type.8 +4 -4
  76. data/man/man8/puppet-status.8 +5 -5
  77. data/man/man8/puppet.8 +12 -3
  78. data/spec/fixtures/unit/application/environments/production/data/common.yaml +2 -0
  79. data/spec/integration/agent/logging_spec.rb +2 -0
  80. data/spec/integration/provider/cron/crontab_spec.rb +1 -0
  81. data/spec/unit/agent_spec.rb +33 -0
  82. data/spec/unit/application/config_spec.rb +4 -0
  83. data/spec/unit/application/inspect_spec.rb +11 -0
  84. data/spec/unit/application/lookup_spec.rb +30 -0
  85. data/spec/unit/application_spec.rb +18 -0
  86. data/spec/unit/environments_spec.rb +15 -0
  87. data/spec/unit/face/config_spec.rb +1 -2
  88. data/spec/unit/functions/break_spec.rb +108 -49
  89. data/spec/unit/functions/defined_spec.rb +2 -2
  90. data/spec/unit/functions/lookup_spec.rb +88 -3
  91. data/spec/unit/interface_spec.rb +12 -0
  92. data/spec/unit/module_tool/tar/mini_spec.rb +34 -5
  93. data/spec/unit/network/http/factory_spec.rb +22 -0
  94. data/spec/unit/network/http/webrick_spec.rb +30 -29
  95. data/spec/unit/parser/functions/sprintf_spec.rb +26 -0
  96. data/spec/unit/pops/loaders/static_loader_spec.rb +1 -1
  97. data/spec/unit/pops/types/type_calculator_spec.rb +21 -0
  98. data/spec/unit/pops/types/type_mismatch_describer_spec.rb +9 -0
  99. data/spec/unit/provider/service/smf_spec.rb +2 -4
  100. data/spec/unit/provider/service/systemd_spec.rb +14 -0
  101. data/spec/unit/resource/catalog_spec.rb +10 -0
  102. data/spec/unit/transaction/report_spec.rb +19 -0
  103. data/spec/unit/util/http_proxy_spec.rb +37 -0
  104. metadata +4 -2
@@ -58,6 +58,20 @@ describe Puppet::Type.type(:service).provider(:systemd) do
58
58
  end
59
59
  end
60
60
 
61
+ it "should be the default provider on Amazon Linux 2.0" do
62
+ Facter.stubs(:value).with(:osfamily).returns(:redhat)
63
+ Facter.stubs(:value).with(:operatingsystem).returns(:amazon)
64
+ Facter.stubs(:value).with(:operatingsystemmajrelease).returns("2")
65
+ expect(described_class).to be_default
66
+ end
67
+
68
+ it "should not be the default provider on Amazon Linux 2017.09" do
69
+ Facter.stubs(:value).with(:osfamily).returns(:redhat)
70
+ Facter.stubs(:value).with(:operatingsystem).returns(:amazon)
71
+ Facter.stubs(:value).with(:operatingsystemmajrelease).returns("2017")
72
+ expect(described_class).not_to be_default
73
+ end
74
+
61
75
  it "should be the default provider on cumulus3" do
62
76
  Facter.stubs(:value).with(:osfamily).returns(:debian)
63
77
  Facter.stubs(:value).with(:operatingsystem).returns('CumulusLinux')
@@ -653,6 +653,16 @@ describe Puppet::Resource::Catalog, "when compiling" do
653
653
  @catalog.apply(:ignoreschedules => true)
654
654
  end
655
655
 
656
+ it "should detect transaction failure and report it" do
657
+ @transaction.stubs(:evaluate).raises(RuntimeError, 'transaction failed.')
658
+ report = Puppet::Transaction::Report.new('apply')
659
+
660
+ expect { @catalog.apply(:report => report) }.to raise_error(RuntimeError)
661
+ report.finalize_report
662
+
663
+ expect(report.status).to eq('failed')
664
+ end
665
+
656
666
  describe "host catalogs" do
657
667
 
658
668
  # super() doesn't work in the setup method for some reason
@@ -247,6 +247,19 @@ describe Puppet::Transaction::Report do
247
247
  end
248
248
  end
249
249
 
250
+ it "should be unchanged if there are no other failures or changes and the transaction completed" do
251
+ @report.transaction_completed = true
252
+ @report.finalize_report
253
+
254
+ expect(@report.status).to eq("unchanged")
255
+ end
256
+
257
+ it "should be failed if there are no other failures or changes and the transaction did not complete" do
258
+ @report.finalize_report
259
+
260
+ expect(@report.status).to eq("failed")
261
+ end
262
+
250
263
  [:time, :resources, :changes, :events].each do |type|
251
264
  it "should add #{type} metrics" do
252
265
  @report.finalize_report
@@ -278,12 +291,14 @@ describe Puppet::Transaction::Report do
278
291
 
279
292
  it "should mark the report as 'failed' if there are failing resources" do
280
293
  add_statuses(1) { |status| status.failed = true }
294
+ @report.transaction_completed = true
281
295
  @report.finalize_report
282
296
  expect(@report.status).to eq('failed')
283
297
  end
284
298
 
285
299
  it "should mark the report as 'failed' if resources_failed_to_generate" do
286
300
  @report.resources_failed_to_generate = true
301
+ @report.transaction_completed = true
287
302
  @report.finalize_report
288
303
  expect(@report.status).to eq('failed')
289
304
  end
@@ -292,12 +307,14 @@ describe Puppet::Transaction::Report do
292
307
  describe "for changes" do
293
308
  it "should provide the number of changes from the resource statuses and mark the report as 'changed'" do
294
309
  add_statuses(3) { |status| 3.times { status << Puppet::Transaction::Event.new(:status => 'success') } }
310
+ @report.transaction_completed = true
295
311
  @report.finalize_report
296
312
  expect(metric(:changes, "total")).to eq(9)
297
313
  expect(@report.status).to eq('changed')
298
314
  end
299
315
 
300
316
  it "should provide a total even if there are no changes, and mark the report as 'unchanged'" do
317
+ @report.transaction_completed = true
301
318
  @report.finalize_report
302
319
  expect(metric(:changes, "total")).to eq(0)
303
320
  expect(@report.status).to eq('unchanged')
@@ -595,6 +612,7 @@ describe Puppet::Transaction::Report do
595
612
  report.cached_catalog_status = "not_used"
596
613
  report.master_used = "test:000"
597
614
  report.add_resource_status(status)
615
+ report.transaction_completed = true
598
616
  report.finalize_report
599
617
  report
600
618
  end
@@ -612,6 +630,7 @@ describe Puppet::Transaction::Report do
612
630
  report.cached_catalog_status = "not_used"
613
631
  report.master_used = "test:000"
614
632
  report.add_resource_status(status)
633
+ report.transaction_completed = true
615
634
  report.finalize_report
616
635
  report
617
636
  end
@@ -213,4 +213,41 @@ describe Puppet::Util::HttpProxy do
213
213
  end
214
214
  end
215
215
  end
216
+
217
+ describe '.request_with_redirects' do
218
+ let(:dest) { URI.parse('http://mydomain.com/some/path') }
219
+ let(:http_ok) { stub('http ok', :code => 200, :message => 'HTTP OK') }
220
+
221
+ it 'generates accept and accept-encoding headers' do
222
+ Net::HTTP.any_instance.stubs(:head).returns(http_ok)
223
+ Net::HTTP.any_instance.expects(:get).with do |_, headers|
224
+ expect(headers)
225
+ .to match({'Accept' => '*/*',
226
+ 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
227
+ 'User-Agent' => /Puppet/})
228
+ end.returns(http_ok)
229
+
230
+ subject.request_with_redirects(dest, :get, 0)
231
+ end
232
+
233
+ it 'generates accept and accept-encoding headers when a block is provided' do
234
+ Net::HTTP.any_instance.stubs(:head).returns(http_ok)
235
+ Net::HTTP.any_instance.expects(:request_get).with do |_, headers, &block|
236
+ expect(headers)
237
+ .to match({'Accept' => '*/*',
238
+ 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
239
+ 'User-Agent' => /Puppet/})
240
+ end.returns(http_ok)
241
+
242
+ subject.request_with_redirects(dest, :get, 0) do
243
+ # unused
244
+ end
245
+ end
246
+
247
+ it 'only makes a single HEAD request' do
248
+ Net::HTTP.any_instance.expects(:head).with(anything, anything).returns(http_ok)
249
+
250
+ subject.request_with_redirects(dest, :head, 0)
251
+ end
252
+ end
216
253
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.10.9
4
+ version: 4.10.10
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-02 00:00:00.000000000 Z
11
+ date: 2018-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facter
@@ -1506,9 +1506,11 @@ files:
1506
1506
  - man/man8/puppet-facts.8
1507
1507
  - man/man8/puppet-file.8
1508
1508
  - man/man8/puppet-filebucket.8
1509
+ - man/man8/puppet-generate.8
1509
1510
  - man/man8/puppet-help.8
1510
1511
  - man/man8/puppet-inspect.8
1511
1512
  - man/man8/puppet-key.8
1513
+ - man/man8/puppet-lookup.8
1512
1514
  - man/man8/puppet-man.8
1513
1515
  - man/man8/puppet-master.8
1514
1516
  - man/man8/puppet-module.8