puppet 6.0.4-universal-darwin → 6.0.5-universal-darwin

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 (125) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +15 -15
  3. data/Rakefile +3 -1
  4. data/ext/solaris/smf/svc-puppetd +8 -1
  5. data/ext/solaris/smf/svc-puppetmasterd +8 -1
  6. data/lib/puppet/application/device.rb +48 -32
  7. data/lib/puppet/application/ssl.rb +31 -17
  8. data/lib/puppet/defaults.rb +2 -1
  9. data/lib/puppet/face/config.rb +1 -1
  10. data/lib/puppet/forge.rb +4 -1
  11. data/lib/puppet/pops/evaluator/collectors/abstract_collector.rb +3 -1
  12. data/lib/puppet/pops/model/pn_transformer.rb +5 -0
  13. data/lib/puppet/pops/types/p_timespan_type.rb +2 -2
  14. data/lib/puppet/pops/types/string_converter.rb +11 -2
  15. data/lib/puppet/provider/package/dnf.rb +2 -1
  16. data/lib/puppet/provider/package/windows/exe_package.rb +13 -0
  17. data/lib/puppet/provider/package/windows/msi_package.rb +8 -0
  18. data/lib/puppet/provider/package/windows/package.rb +9 -1
  19. data/lib/puppet/provider/package/yum.rb +1 -1
  20. data/lib/puppet/provider/parsedfile.rb +25 -4
  21. data/lib/puppet/provider/service/smf.rb +54 -0
  22. data/lib/puppet/provider/service/systemd.rb +2 -0
  23. data/lib/puppet/provider/service/upstart.rb +1 -0
  24. data/lib/puppet/rest/route.rb +1 -1
  25. data/lib/puppet/ssl/host.rb +23 -11
  26. data/lib/puppet/transaction.rb +4 -1
  27. data/lib/puppet/transaction/event_manager.rb +13 -1
  28. data/lib/puppet/transaction/resource_harness.rb +3 -1
  29. data/lib/puppet/util/command_line.rb +2 -3
  30. data/lib/puppet/util/filetype.rb +36 -4
  31. data/lib/puppet/util/selinux.rb +1 -1
  32. data/lib/puppet/util/windows/api_types.rb +1 -1
  33. data/lib/puppet/util/windows/registry.rb +29 -5
  34. data/lib/puppet/util/windows/service.rb +106 -99
  35. data/lib/puppet/version.rb +1 -1
  36. data/locales/ja/puppet.po +232 -183
  37. data/locales/puppet.pot +145 -117
  38. data/man/man5/puppet.conf.5 +3 -3
  39. data/man/man8/puppet-agent.8 +1 -1
  40. data/man/man8/puppet-apply.8 +1 -1
  41. data/man/man8/puppet-catalog.8 +1 -1
  42. data/man/man8/puppet-config.8 +2 -2
  43. data/man/man8/puppet-describe.8 +1 -1
  44. data/man/man8/puppet-device.8 +23 -19
  45. data/man/man8/puppet-doc.8 +1 -1
  46. data/man/man8/puppet-epp.8 +1 -1
  47. data/man/man8/puppet-facts.8 +1 -1
  48. data/man/man8/puppet-filebucket.8 +1 -1
  49. data/man/man8/puppet-generate.8 +1 -1
  50. data/man/man8/puppet-help.8 +1 -1
  51. data/man/man8/puppet-key.8 +1 -1
  52. data/man/man8/puppet-lookup.8 +1 -1
  53. data/man/man8/puppet-man.8 +1 -1
  54. data/man/man8/puppet-module.8 +1 -1
  55. data/man/man8/puppet-node.8 +1 -1
  56. data/man/man8/puppet-parser.8 +1 -1
  57. data/man/man8/puppet-plugin.8 +1 -1
  58. data/man/man8/puppet-report.8 +1 -1
  59. data/man/man8/puppet-resource.8 +1 -1
  60. data/man/man8/puppet-script.8 +1 -1
  61. data/man/man8/puppet-ssl.8 +6 -3
  62. data/man/man8/puppet-status.8 +1 -1
  63. data/man/man8/puppet.8 +2 -2
  64. data/spec/fixtures/unit/provider/service/smf/svcs_fmri.out +6 -0
  65. data/spec/fixtures/unit/provider/service/smf/svcs_multiple_fmris.out +13 -0
  66. data/spec/integration/ssl/key_spec.rb +0 -4
  67. data/spec/integration/transaction_spec.rb +559 -0
  68. data/spec/integration/util/windows/registry_spec.rb +39 -0
  69. data/spec/unit/application/device_spec.rb +10 -7
  70. data/spec/unit/application/lookup_spec.rb +2 -1
  71. data/spec/unit/application/ssl_spec.rb +21 -2
  72. data/spec/unit/forge/forge_spec.rb +4 -2
  73. data/spec/unit/functions/logging_spec.rb +10 -3
  74. data/spec/unit/indirector/yaml_spec.rb +1 -1
  75. data/spec/unit/pops/loaders/loader_spec.rb +6 -7
  76. data/spec/unit/pops/model/pn_transformer_spec.rb +4 -0
  77. data/spec/unit/pops/types/p_timespan_type_spec.rb +22 -0
  78. data/spec/unit/pops/types/p_timestamp_type_spec.rb +19 -0
  79. data/spec/unit/pops/types/string_converter_spec.rb +20 -0
  80. data/spec/unit/provider/group/ldap_spec.rb +22 -25
  81. data/spec/unit/provider/group/pw_spec.rb +7 -10
  82. data/spec/unit/provider/nameservice/directoryservice_spec.rb +97 -103
  83. data/spec/unit/provider/package/aix_spec.rb +5 -8
  84. data/spec/unit/provider/package/apt_spec.rb +3 -6
  85. data/spec/unit/provider/package/dnf_spec.rb +36 -37
  86. data/spec/unit/provider/package/dpkg_spec.rb +18 -21
  87. data/spec/unit/provider/package/freebsd_spec.rb +4 -7
  88. data/spec/unit/provider/package/gem_spec.rb +41 -41
  89. data/spec/unit/provider/package/hpux_spec.rb +7 -10
  90. data/spec/unit/provider/package/macports_spec.rb +13 -15
  91. data/spec/unit/provider/package/nim_spec.rb +3 -10
  92. data/spec/unit/provider/package/openbsd_spec.rb +14 -17
  93. data/spec/unit/provider/package/pip3_spec.rb +3 -6
  94. data/spec/unit/provider/package/pip_spec.rb +45 -49
  95. data/spec/unit/provider/package/pkgin_spec.rb +13 -18
  96. data/spec/unit/provider/package/pkgng_spec.rb +21 -24
  97. data/spec/unit/provider/package/puppet_gem_spec.rb +6 -9
  98. data/spec/unit/provider/package/tdnf_spec.rb +9 -12
  99. data/spec/unit/provider/package/yum_spec.rb +30 -16
  100. data/spec/unit/provider/package/zypper_spec.rb +17 -19
  101. data/spec/unit/provider/service/bsd_spec.rb +7 -9
  102. data/spec/unit/provider/service/daemontools_spec.rb +12 -16
  103. data/spec/unit/provider/service/debian_spec.rb +6 -10
  104. data/spec/unit/provider/service/freebsd_spec.rb +2 -2
  105. data/spec/unit/provider/service/openbsd_spec.rb +13 -17
  106. data/spec/unit/provider/service/rcng_spec.rb +2 -4
  107. data/spec/unit/provider/service/redhat_spec.rb +12 -11
  108. data/spec/unit/provider/service/runit_spec.rb +7 -14
  109. data/spec/unit/provider/service/smf_spec.rb +77 -13
  110. data/spec/unit/provider/service/src_spec.rb +11 -16
  111. data/spec/unit/provider/service/systemd_spec.rb +18 -0
  112. data/spec/unit/provider/user/hpux_spec.rb +3 -5
  113. data/spec/unit/provider/user/ldap_spec.rb +29 -32
  114. data/spec/unit/provider/user/pw_spec.rb +10 -13
  115. data/spec/unit/rest/route_spec.rb +1 -1
  116. data/spec/unit/ssl/host_spec.rb +21 -0
  117. data/spec/unit/ssl/key_spec.rb +2 -4
  118. data/spec/unit/transaction/event_manager_spec.rb +12 -1
  119. data/spec/unit/transaction/resource_harness_spec.rb +18 -0
  120. data/spec/unit/transaction_spec.rb +25 -0
  121. data/spec/unit/util/filetype_spec.rb +13 -5
  122. data/spec/unit/util/logging_spec.rb +0 -41
  123. data/spec/unit/util/monkey_patches_spec.rb +18 -5
  124. data/spec/unit/util/selinux_spec.rb +4 -0
  125. metadata +8 -2
@@ -174,11 +174,22 @@ describe Puppet::Transaction::EventManager do
174
174
  expect(@transaction.resource_status(@resource)).to be_restarted
175
175
  end
176
176
 
177
+ it "should have an event on the resource status" do
178
+ @manager.expects(:queued_events).with(@resource).yields(:callback1, [@event])
179
+
180
+ @resource.stubs(:callback1)
181
+
182
+ @manager.process_events(@resource) #x
183
+
184
+ expect(@transaction.resource_status(@resource).events.length).to eq(1)
185
+ end
186
+
177
187
  it "should queue a 'restarted' event generated by the resource" do
178
188
  @manager.expects(:queued_events).with(@resource).yields(:callback1, [@event])
179
189
 
180
190
  @resource.stubs(:callback1)
181
191
 
192
+ @resource.expects(:event).with(:message => "Triggered 'callback1' from 1 event", :status => 'success', :name => 'callback1')
182
193
  @resource.expects(:event).with(:name => :restarted, :status => "success").returns "myevent"
183
194
  @manager.expects(:queue_events).with(@resource, ["myevent"])
184
195
 
@@ -295,7 +306,7 @@ describe Puppet::Transaction::EventManager do
295
306
  it "should record a failed event on the resource status" do
296
307
  @manager.process_events(@resource)
297
308
 
298
- expect(@transaction.resource_status(@resource).events.length).to eq(1)
309
+ expect(@transaction.resource_status(@resource).events.length).to eq(2)
299
310
  expect(@transaction.resource_status(@resource).events[0].status).to eq('failure')
300
311
  end
301
312
 
@@ -173,6 +173,10 @@ describe Puppet::Transaction::ResourceHarness do
173
173
  def insync?(value)
174
174
  @resource.behaviors[:ensure_insync?]
175
175
  end
176
+
177
+ def should_to_s(value)
178
+ (@resource.behaviors[:on_should_to_s] || proc { "'#{value}'" }).call
179
+ end
176
180
  end
177
181
 
178
182
  newparam(:name) do
@@ -266,6 +270,20 @@ describe Puppet::Transaction::ResourceHarness do
266
270
 
267
271
  expect(status.events).to be_empty
268
272
  end
273
+
274
+ it "ensure errors in message still get a log entry" do
275
+ resource = an_ensurable_resource_reacting_as(:ensure_insync? => false, :on_ensure => proc { raise StandardError }, :on_should_to_s => proc { raise StandardError }, :present? => true)
276
+
277
+ status = @harness.evaluate(resource)
278
+
279
+ expect(status.events.length).to eq(2)
280
+ testing_errors = status.events.find_all { |x| x.name.to_s == "Testing_created" }
281
+ resource_errors = status.events.find_all { |x| x.name.to_s == "resource_error" }
282
+ expect(testing_errors.length).to eq(1)
283
+ expect(resource_errors.length).to eq(1)
284
+ expect(testing_errors[0].message).not_to be_nil
285
+ expect(resource_errors[0].message).not_to eq("Puppet::Util::Log requires a message")
286
+ end
269
287
  end
270
288
 
271
289
  describe "when a caught error occurs" do
@@ -3,6 +3,7 @@ require 'matchers/include_in_order'
3
3
  require 'puppet_spec/compiler'
4
4
 
5
5
  require 'puppet/transaction'
6
+ require 'puppet/type/notify'
6
7
  require 'fileutils'
7
8
 
8
9
  describe Puppet::Transaction do
@@ -896,6 +897,30 @@ describe Puppet::Transaction do
896
897
  expect(transaction.report.resource_statuses['Notify[b]']).to be_skipped
897
898
  end
898
899
  end
900
+
901
+ describe "failed dependency is depended on multiple times" do
902
+ it "notifies the failed dependency once" do
903
+ command_string = File.expand_path('/my/command')
904
+ Puppet::Util::Execution.stubs(:execute).with([command_string]).raises(Puppet::ExecutionFailure, "Failed")
905
+
906
+ Puppet::Type::Notify.any_instance.expects(:send_log).with(:notice, "Dependency Exec[exec1] has failures: true")
907
+ Puppet::Type::Notify.any_instance.expects(:send_log).with(:notice, "Dependency Exec[exec2] has failures: true")
908
+ Puppet::Type::Notify.any_instance.expects(:send_log).with(:notice, "Dependency Exec[exec3] has failures: true")
909
+ Puppet::Type::Notify.any_instance.expects(:send_log).with(:notice, "Dependency Exec[exec4] has failures: true")
910
+ Puppet::Type::Notify.any_instance.expects(:send_log).with(:notice, "Dependency Exec[exec5] has failures: true")
911
+
912
+ Puppet::Type::Notify.any_instance.expects(:send_log).with(:warning, "Skipping because of failed dependencies").times(3)
913
+
914
+ apply_compiled_manifest(<<-MANIFEST)
915
+ exec { ['exec1', 'exec2', 'exec3', 'exec4', 'exec5']:
916
+ command => '#{command_string}'
917
+ } ->
918
+ notify { ['notify1', 'notify2', 'notify3']: }
919
+ MANIFEST
920
+
921
+ end
922
+ end
923
+
899
924
  end
900
925
 
901
926
  describe Puppet::Transaction, " when determining tags" do
@@ -107,6 +107,10 @@ describe Puppet::Util::FileType do
107
107
  end
108
108
 
109
109
  describe "#read" do
110
+ before(:each) do
111
+ Puppet::Util.stubs(:uid).with(uid).returns 9000
112
+ end
113
+
110
114
  it "should run crontab -l as the target user" do
111
115
  Puppet::Util::Execution.expects(:execute)
112
116
  .with(['crontab', '-l'], user_options)
@@ -115,7 +119,7 @@ describe Puppet::Util::FileType do
115
119
  end
116
120
 
117
121
  it "should not switch user if current user is the target user" do
118
- Puppet::Util.expects(:uid).with(uid).returns 9000
122
+ Puppet::Util.expects(:uid).with(uid).twice.returns 9000
119
123
  Puppet::Util::SUIDManager.expects(:uid).returns 9000
120
124
  Puppet::Util::Execution
121
125
  .expects(:execute).with(['crontab', '-l'], options)
@@ -128,11 +132,15 @@ describe Puppet::Util::FileType do
128
132
  expect(cron.read).to eq('')
129
133
  end
130
134
 
131
- it "should raise an error if the user is not authorized to use cron" do
135
+ it "should treat a nonexistent user's crontab as empty" do
136
+ Puppet::Util.expects(:uid).with(uid).returns nil
137
+
138
+ expect(cron.read).to eq('')
139
+ end
140
+
141
+ it "should return empty if the user is not authorized to use cron" do
132
142
  Puppet::Util::Execution.expects(:execute).with(['crontab', '-l'], user_options).raises(Puppet::ExecutionFailure, unauthorized_crontab)
133
- expect {
134
- cron.read
135
- }.to raise_error Puppet::Error, /User #{uid} not authorized to use cron/
143
+ expect(cron.read).to eq('')
136
144
  end
137
145
  end
138
146
 
@@ -360,21 +360,6 @@ original
360
360
  Facter.unstub(:debugging)
361
361
  end
362
362
 
363
- describe 'does not support debugging' do
364
- before :each do
365
- Facter.stubs(:respond_to?).with(:debugging).returns false
366
- Facter.stubs(:debugging).never
367
- end
368
-
369
- it 'does not enable Facter debugging for debug level' do
370
- Puppet::Util::Log.level = :debug
371
- end
372
-
373
- it 'does not enable Facter debugging non-debug level' do
374
- Puppet::Util::Log.level = :info
375
- end
376
- end
377
-
378
363
  describe 'does support debugging' do
379
364
  before :each do
380
365
  Facter.stubs(:respond_to?).with(:debugging).returns true
@@ -391,21 +376,6 @@ original
391
376
  end
392
377
  end
393
378
 
394
- describe 'does not support trace' do
395
- before :each do
396
- Facter.stubs(:respond_to?).with(:trace).returns false
397
- Facter.stubs(:trace).never
398
- end
399
-
400
- it 'does not enable Facter trace when enabled' do
401
- Puppet[:trace] = true
402
- end
403
-
404
- it 'does not enable Facter trace when disabled' do
405
- Puppet[:trace] = false
406
- end
407
- end
408
-
409
379
  describe 'does support trace' do
410
380
  before :each do
411
381
  Facter.stubs(:respond_to?).with(:trace).returns true
@@ -422,17 +392,6 @@ original
422
392
  end
423
393
  end
424
394
 
425
- describe 'does not support on_message' do
426
- before :each do
427
- Facter.stubs(:respond_to?).with(:on_message).returns false
428
- Facter.stubs(:on_message).never
429
- end
430
-
431
- it 'does not call Facter.on_message' do
432
- expect(Puppet::Util::Logging::setup_facter_logging!).to be_falsey
433
- end
434
- end
435
-
436
395
  describe 'does support on_message' do
437
396
  before :each do
438
397
  Facter.stubs(:respond_to?).with(:on_message).returns true
@@ -101,13 +101,26 @@ describe OpenSSL::X509::Store, :if => Puppet::Util::Platform.windows? do
101
101
  store.set_default_paths
102
102
  end
103
103
 
104
- it "warns when adding a certificate that already exists" do
105
- with_root_certs([cert])
106
- store.add_cert(cert)
104
+ # openssl 1.1.1 ignores duplicate certs
105
+ # https://github.com/openssl/openssl/commit/c0452248ea1a59a41023a4765ef7d9825e80a62b
106
+ if OpenSSL::OPENSSL_VERSION_NUMBER < 0x10101000
107
+ it "warns when adding a certificate that already exists" do
108
+ with_root_certs([cert])
109
+ store.add_cert(cert)
107
110
 
108
- store.expects(:warn).with('Failed to add /DC=com/DC=microsoft/CN=Microsoft Root Certificate Authority')
111
+ store.expects(:warn).with('Failed to add /DC=com/DC=microsoft/CN=Microsoft Root Certificate Authority')
109
112
 
110
- store.set_default_paths
113
+ store.set_default_paths
114
+ end
115
+ else
116
+ it "doesn't warn when adding a duplicate cert" do
117
+ with_root_certs([cert])
118
+ store.add_cert(cert)
119
+
120
+ store.expects(:warn).never
121
+
122
+ store.set_default_paths
123
+ end
111
124
  end
112
125
 
113
126
  it "raises when adding an invalid certificate" do
@@ -73,6 +73,10 @@ describe Puppet::Util::SELinux do
73
73
  expect(selinux_label_support?('/etc/puppetlabs/puppet/testfile')).to be_truthy
74
74
  end
75
75
 
76
+ it "should return true if tmpfs" do
77
+ expect(selinux_label_support?('/dev/shm/testfile')).to be_truthy
78
+ end
79
+
76
80
  it "should return false for a noncapable filesystem" do
77
81
  expect(selinux_label_support?('/mnt/nfs/testfile')).to be_falsey
78
82
  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: 6.0.4
4
+ version: 6.0.5
5
5
  platform: universal-darwin
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-31 00:00:00.000000000 Z
11
+ date: 2019-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facter
@@ -1666,6 +1666,8 @@ files:
1666
1666
  - spec/fixtures/unit/provider/service/openrc/rcservice_list
1667
1667
  - spec/fixtures/unit/provider/service/openrc/rcstatus
1668
1668
  - spec/fixtures/unit/provider/service/smf/svcs.out
1669
+ - spec/fixtures/unit/provider/service/smf/svcs_fmri.out
1670
+ - spec/fixtures/unit/provider/service/smf/svcs_multiple_fmris.out
1669
1671
  - spec/fixtures/unit/provider/service/systemd/list_unit_files_services
1670
1672
  - spec/fixtures/unit/provider/user/aix/aix_passwd_file.out
1671
1673
  - spec/fixtures/unit/reports/tagmail/tagmail_email.conf
@@ -1749,6 +1751,7 @@ files:
1749
1751
  - spec/integration/ssl/key_spec.rb
1750
1752
  - spec/integration/test/test_helper_spec.rb
1751
1753
  - spec/integration/transaction/report_spec.rb
1754
+ - spec/integration/transaction_spec.rb
1752
1755
  - spec/integration/type/exec_spec.rb
1753
1756
  - spec/integration/type/file_spec.rb
1754
1757
  - spec/integration/type/package_spec.rb
@@ -2863,6 +2866,8 @@ test_files:
2863
2866
  - spec/fixtures/unit/provider/service/openrc/rcservice_list
2864
2867
  - spec/fixtures/unit/provider/service/openrc/rcstatus
2865
2868
  - spec/fixtures/unit/provider/service/smf/svcs.out
2869
+ - spec/fixtures/unit/provider/service/smf/svcs_fmri.out
2870
+ - spec/fixtures/unit/provider/service/smf/svcs_multiple_fmris.out
2866
2871
  - spec/fixtures/unit/provider/service/systemd/list_unit_files_services
2867
2872
  - spec/fixtures/unit/provider/user/aix/aix_passwd_file.out
2868
2873
  - spec/fixtures/unit/reports/tagmail/tagmail_email.conf
@@ -2946,6 +2951,7 @@ test_files:
2946
2951
  - spec/integration/ssl/key_spec.rb
2947
2952
  - spec/integration/test/test_helper_spec.rb
2948
2953
  - spec/integration/transaction/report_spec.rb
2954
+ - spec/integration/transaction_spec.rb
2949
2955
  - spec/integration/type/exec_spec.rb
2950
2956
  - spec/integration/type/file_spec.rb
2951
2957
  - spec/integration/type/package_spec.rb