puppet 6.0.4-x86-mingw32 → 6.0.5-x86-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.
- checksums.yaml +4 -4
- data/Gemfile.lock +15 -15
- data/Rakefile +3 -1
- data/ext/solaris/smf/svc-puppetd +8 -1
- data/ext/solaris/smf/svc-puppetmasterd +8 -1
- data/lib/puppet/application/device.rb +48 -32
- data/lib/puppet/application/ssl.rb +31 -17
- data/lib/puppet/defaults.rb +2 -1
- data/lib/puppet/face/config.rb +1 -1
- data/lib/puppet/forge.rb +4 -1
- data/lib/puppet/pops/evaluator/collectors/abstract_collector.rb +3 -1
- data/lib/puppet/pops/model/pn_transformer.rb +5 -0
- data/lib/puppet/pops/types/p_timespan_type.rb +2 -2
- data/lib/puppet/pops/types/string_converter.rb +11 -2
- data/lib/puppet/provider/package/dnf.rb +2 -1
- data/lib/puppet/provider/package/windows/exe_package.rb +13 -0
- data/lib/puppet/provider/package/windows/msi_package.rb +8 -0
- data/lib/puppet/provider/package/windows/package.rb +9 -1
- data/lib/puppet/provider/package/yum.rb +1 -1
- data/lib/puppet/provider/parsedfile.rb +25 -4
- data/lib/puppet/provider/service/smf.rb +54 -0
- data/lib/puppet/provider/service/systemd.rb +2 -0
- data/lib/puppet/provider/service/upstart.rb +1 -0
- data/lib/puppet/rest/route.rb +1 -1
- data/lib/puppet/ssl/host.rb +23 -11
- data/lib/puppet/transaction.rb +4 -1
- data/lib/puppet/transaction/event_manager.rb +13 -1
- data/lib/puppet/transaction/resource_harness.rb +3 -1
- data/lib/puppet/util/command_line.rb +2 -3
- data/lib/puppet/util/filetype.rb +36 -4
- data/lib/puppet/util/selinux.rb +1 -1
- data/lib/puppet/util/windows/api_types.rb +1 -1
- data/lib/puppet/util/windows/registry.rb +29 -5
- data/lib/puppet/util/windows/service.rb +106 -99
- data/lib/puppet/version.rb +1 -1
- data/locales/ja/puppet.po +232 -183
- data/locales/puppet.pot +145 -117
- data/man/man5/puppet.conf.5 +3 -3
- data/man/man8/puppet-agent.8 +1 -1
- data/man/man8/puppet-apply.8 +1 -1
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-config.8 +2 -2
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +23 -19
- data/man/man8/puppet-doc.8 +1 -1
- data/man/man8/puppet-epp.8 +1 -1
- data/man/man8/puppet-facts.8 +1 -1
- data/man/man8/puppet-filebucket.8 +1 -1
- data/man/man8/puppet-generate.8 +1 -1
- data/man/man8/puppet-help.8 +1 -1
- data/man/man8/puppet-key.8 +1 -1
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-man.8 +1 -1
- data/man/man8/puppet-module.8 +1 -1
- data/man/man8/puppet-node.8 +1 -1
- data/man/man8/puppet-parser.8 +1 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-report.8 +1 -1
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-script.8 +1 -1
- data/man/man8/puppet-ssl.8 +6 -3
- data/man/man8/puppet-status.8 +1 -1
- data/man/man8/puppet.8 +2 -2
- data/spec/fixtures/unit/provider/service/smf/svcs_fmri.out +6 -0
- data/spec/fixtures/unit/provider/service/smf/svcs_multiple_fmris.out +13 -0
- data/spec/integration/ssl/key_spec.rb +0 -4
- data/spec/integration/transaction_spec.rb +559 -0
- data/spec/integration/util/windows/registry_spec.rb +39 -0
- data/spec/unit/application/device_spec.rb +10 -7
- data/spec/unit/application/lookup_spec.rb +2 -1
- data/spec/unit/application/ssl_spec.rb +21 -2
- data/spec/unit/forge/forge_spec.rb +4 -2
- data/spec/unit/functions/logging_spec.rb +10 -3
- data/spec/unit/indirector/yaml_spec.rb +1 -1
- data/spec/unit/pops/loaders/loader_spec.rb +6 -7
- data/spec/unit/pops/model/pn_transformer_spec.rb +4 -0
- data/spec/unit/pops/types/p_timespan_type_spec.rb +22 -0
- data/spec/unit/pops/types/p_timestamp_type_spec.rb +19 -0
- data/spec/unit/pops/types/string_converter_spec.rb +20 -0
- data/spec/unit/provider/group/ldap_spec.rb +22 -25
- data/spec/unit/provider/group/pw_spec.rb +7 -10
- data/spec/unit/provider/nameservice/directoryservice_spec.rb +97 -103
- data/spec/unit/provider/package/aix_spec.rb +5 -8
- data/spec/unit/provider/package/apt_spec.rb +3 -6
- data/spec/unit/provider/package/dnf_spec.rb +36 -37
- data/spec/unit/provider/package/dpkg_spec.rb +18 -21
- data/spec/unit/provider/package/freebsd_spec.rb +4 -7
- data/spec/unit/provider/package/gem_spec.rb +41 -41
- data/spec/unit/provider/package/hpux_spec.rb +7 -10
- data/spec/unit/provider/package/macports_spec.rb +13 -15
- data/spec/unit/provider/package/nim_spec.rb +3 -10
- data/spec/unit/provider/package/openbsd_spec.rb +14 -17
- data/spec/unit/provider/package/pip3_spec.rb +3 -6
- data/spec/unit/provider/package/pip_spec.rb +45 -49
- data/spec/unit/provider/package/pkgin_spec.rb +13 -18
- data/spec/unit/provider/package/pkgng_spec.rb +21 -24
- data/spec/unit/provider/package/puppet_gem_spec.rb +6 -9
- data/spec/unit/provider/package/tdnf_spec.rb +9 -12
- data/spec/unit/provider/package/yum_spec.rb +30 -16
- data/spec/unit/provider/package/zypper_spec.rb +17 -19
- data/spec/unit/provider/service/bsd_spec.rb +7 -9
- data/spec/unit/provider/service/daemontools_spec.rb +12 -16
- data/spec/unit/provider/service/debian_spec.rb +6 -10
- data/spec/unit/provider/service/freebsd_spec.rb +2 -2
- data/spec/unit/provider/service/openbsd_spec.rb +13 -17
- data/spec/unit/provider/service/rcng_spec.rb +2 -4
- data/spec/unit/provider/service/redhat_spec.rb +12 -11
- data/spec/unit/provider/service/runit_spec.rb +7 -14
- data/spec/unit/provider/service/smf_spec.rb +77 -13
- data/spec/unit/provider/service/src_spec.rb +11 -16
- data/spec/unit/provider/service/systemd_spec.rb +18 -0
- data/spec/unit/provider/user/hpux_spec.rb +3 -5
- data/spec/unit/provider/user/ldap_spec.rb +29 -32
- data/spec/unit/provider/user/pw_spec.rb +10 -13
- data/spec/unit/rest/route_spec.rb +1 -1
- data/spec/unit/ssl/host_spec.rb +21 -0
- data/spec/unit/ssl/key_spec.rb +2 -4
- data/spec/unit/transaction/event_manager_spec.rb +12 -1
- data/spec/unit/transaction/resource_harness_spec.rb +18 -0
- data/spec/unit/transaction_spec.rb +25 -0
- data/spec/unit/util/filetype_spec.rb +13 -5
- data/spec/unit/util/logging_spec.rb +0 -41
- data/spec/unit/util/monkey_patches_spec.rb +18 -5
- data/spec/unit/util/selinux_spec.rb +4 -0
- 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(
|
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
|
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
|
-
|
105
|
-
|
106
|
-
|
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
|
-
|
111
|
+
store.expects(:warn).with('Failed to add /DC=com/DC=microsoft/CN=Microsoft Root Certificate Authority')
|
109
112
|
|
110
|
-
|
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
|
+
version: 6.0.5
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facter
|
@@ -1736,6 +1736,8 @@ files:
|
|
1736
1736
|
- spec/fixtures/unit/provider/service/openrc/rcservice_list
|
1737
1737
|
- spec/fixtures/unit/provider/service/openrc/rcstatus
|
1738
1738
|
- spec/fixtures/unit/provider/service/smf/svcs.out
|
1739
|
+
- spec/fixtures/unit/provider/service/smf/svcs_fmri.out
|
1740
|
+
- spec/fixtures/unit/provider/service/smf/svcs_multiple_fmris.out
|
1739
1741
|
- spec/fixtures/unit/provider/service/systemd/list_unit_files_services
|
1740
1742
|
- spec/fixtures/unit/provider/user/aix/aix_passwd_file.out
|
1741
1743
|
- spec/fixtures/unit/reports/tagmail/tagmail_email.conf
|
@@ -1819,6 +1821,7 @@ files:
|
|
1819
1821
|
- spec/integration/ssl/key_spec.rb
|
1820
1822
|
- spec/integration/test/test_helper_spec.rb
|
1821
1823
|
- spec/integration/transaction/report_spec.rb
|
1824
|
+
- spec/integration/transaction_spec.rb
|
1822
1825
|
- spec/integration/type/exec_spec.rb
|
1823
1826
|
- spec/integration/type/file_spec.rb
|
1824
1827
|
- spec/integration/type/package_spec.rb
|
@@ -2933,6 +2936,8 @@ test_files:
|
|
2933
2936
|
- spec/fixtures/unit/provider/service/openrc/rcservice_list
|
2934
2937
|
- spec/fixtures/unit/provider/service/openrc/rcstatus
|
2935
2938
|
- spec/fixtures/unit/provider/service/smf/svcs.out
|
2939
|
+
- spec/fixtures/unit/provider/service/smf/svcs_fmri.out
|
2940
|
+
- spec/fixtures/unit/provider/service/smf/svcs_multiple_fmris.out
|
2936
2941
|
- spec/fixtures/unit/provider/service/systemd/list_unit_files_services
|
2937
2942
|
- spec/fixtures/unit/provider/user/aix/aix_passwd_file.out
|
2938
2943
|
- spec/fixtures/unit/reports/tagmail/tagmail_email.conf
|
@@ -3016,6 +3021,7 @@ test_files:
|
|
3016
3021
|
- spec/integration/ssl/key_spec.rb
|
3017
3022
|
- spec/integration/test/test_helper_spec.rb
|
3018
3023
|
- spec/integration/transaction/report_spec.rb
|
3024
|
+
- spec/integration/transaction_spec.rb
|
3019
3025
|
- spec/integration/type/exec_spec.rb
|
3020
3026
|
- spec/integration/type/file_spec.rb
|
3021
3027
|
- spec/integration/type/package_spec.rb
|