puppet 6.10.1-x64-mingw32 → 6.11.0-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.
- checksums.yaml +4 -4
- data/Gemfile +4 -4
- data/Gemfile.lock +20 -12
- data/ext/project_data.yaml +3 -2
- data/ext/regexp_nodes/regexp_nodes.rb +4 -4
- data/ext/windows/service/daemon.rb +33 -8
- data/install.rb +6 -6
- data/lib/puppet.rb +8 -0
- data/lib/puppet/application.rb +1 -1
- data/lib/puppet/application/agent.rb +3 -0
- data/lib/puppet/application/apply.rb +2 -2
- data/lib/puppet/application/describe.rb +3 -9
- data/lib/puppet/application/device.rb +3 -0
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/application/lookup.rb +1 -1
- data/lib/puppet/application/script.rb +2 -2
- data/lib/puppet/application/ssl.rb +25 -21
- data/lib/puppet/configurer.rb +42 -0
- data/lib/puppet/configurer/downloader.rb +2 -6
- data/lib/puppet/context/trusted_information.rb +42 -4
- data/lib/puppet/defaults.rb +19 -4
- data/lib/puppet/face/module/list.rb +5 -5
- data/lib/puppet/face/module/search.rb +1 -1
- data/lib/puppet/face/module/uninstall.rb +1 -1
- data/lib/puppet/face/module/upgrade.rb +1 -1
- data/lib/puppet/file_serving/http_metadata.rb +1 -1
- data/lib/puppet/file_system.rb +0 -8
- data/lib/puppet/file_system/memory_file.rb +1 -1
- data/lib/puppet/file_system/posix.rb +3 -2
- data/lib/puppet/forge.rb +3 -3
- data/lib/puppet/functions.rb +1 -2
- data/lib/puppet/gettext/module_translations.rb +1 -1
- data/lib/puppet/graph/rb_tree_map.rb +2 -2
- data/lib/puppet/graph/simple_graph.rb +4 -3
- data/lib/puppet/http.rb +29 -0
- data/lib/puppet/http/client.rb +156 -0
- data/lib/puppet/http/errors.rb +30 -0
- data/lib/puppet/http/redirector.rb +48 -0
- data/lib/puppet/http/resolver.rb +5 -0
- data/lib/puppet/http/resolver/settings.rb +5 -0
- data/lib/puppet/http/resolver/srv.rb +13 -0
- data/lib/puppet/http/response.rb +34 -0
- data/lib/puppet/http/retry_after_handler.rb +47 -0
- data/lib/puppet/http/service.rb +18 -0
- data/lib/puppet/http/service/ca.rb +49 -0
- data/lib/puppet/http/session.rb +55 -0
- data/lib/puppet/indirector/file_bucket_file/file.rb +1 -1
- data/lib/puppet/indirector/hiera.rb +2 -0
- data/lib/puppet/indirector/request.rb +1 -1
- data/lib/puppet/indirector/resource/ral.rb +1 -3
- data/lib/puppet/indirector/resource/validator.rb +1 -1
- data/lib/puppet/interface.rb +2 -1
- data/lib/puppet/interface/documentation.rb +1 -1
- data/lib/puppet/loaders.rb +0 -1
- data/lib/puppet/metatype/manager.rb +1 -1
- data/lib/puppet/module.rb +1 -1
- data/lib/puppet/module/task.rb +20 -4
- data/lib/puppet/module_tool/applications/installer.rb +1 -1
- data/lib/puppet/module_tool/applications/uninstaller.rb +3 -3
- data/lib/puppet/module_tool/metadata.rb +1 -1
- data/lib/puppet/module_tool/shared_behaviors.rb +4 -4
- data/lib/puppet/module_tool/tar/mini.rb +1 -1
- data/lib/puppet/network/http.rb +2 -6
- data/lib/puppet/network/http/api/indirected_routes.rb +12 -11
- data/lib/puppet/network/http/connection.rb +10 -12
- data/lib/puppet/network/http/pool.rb +2 -0
- data/lib/puppet/network/http/site.rb +5 -1
- data/lib/puppet/network/resolver.rb +4 -4
- data/lib/puppet/node/environment.rb +4 -2
- data/lib/puppet/pal/pal_impl.rb +2 -2
- data/lib/puppet/parser/ast.rb +1 -1
- data/lib/puppet/parser/ast/resourceparam.rb +1 -1
- data/lib/puppet/parser/functions.rb +1 -1
- data/lib/puppet/parser/scope.rb +8 -7
- data/lib/puppet/pops/evaluator/collectors/catalog_collector.rb +1 -1
- data/lib/puppet/pops/evaluator/collectors/exported_collector.rb +1 -1
- data/lib/puppet/pops/evaluator/external_syntax_support.rb +3 -2
- data/lib/puppet/pops/evaluator/runtime3_support.rb +4 -7
- data/lib/puppet/pops/loader/module_loaders.rb +1 -1
- data/lib/puppet/pops/loader/task_instantiator.rb +4 -0
- data/lib/puppet/pops/loaders.rb +1 -1
- data/lib/puppet/pops/lookup/hiera_config.rb +1 -0
- data/lib/puppet/pops/lookup/sub_lookup.rb +1 -1
- data/lib/puppet/pops/merge_strategy.rb +22 -18
- data/lib/puppet/pops/parser/heredoc_support.rb +1 -1
- data/lib/puppet/pops/parser/interpolation_support.rb +4 -4
- data/lib/puppet/pops/parser/locator.rb +1 -1
- data/lib/puppet/pops/parser/pn_parser.rb +17 -16
- data/lib/puppet/pops/puppet_stack.rb +52 -48
- data/lib/puppet/pops/types/p_sensitive_type.rb +1 -1
- data/lib/puppet/pops/types/p_uri_type.rb +1 -1
- data/lib/puppet/pops/types/string_converter.rb +10 -10
- data/lib/puppet/pops/types/types.rb +3 -3
- data/lib/puppet/property.rb +1 -1
- data/lib/puppet/property/ensure.rb +1 -1
- data/lib/puppet/provider/exec.rb +6 -2
- data/lib/puppet/provider/nameservice/directoryservice.rb +1 -1
- data/lib/puppet/provider/nameservice/pw.rb +2 -2
- data/lib/puppet/provider/package/apt.rb +5 -1
- data/lib/puppet/provider/package/dnfmodule.rb +87 -0
- data/lib/puppet/provider/package/dpkg.rb +31 -17
- data/lib/puppet/provider/package/openbsd.rb +1 -1
- data/lib/puppet/provider/package/pip.rb +34 -9
- data/lib/puppet/provider/package/portage.rb +1 -1
- data/lib/puppet/provider/package/rpm.rb +5 -5
- data/lib/puppet/provider/package/windows/package.rb +1 -1
- data/lib/puppet/provider/package/yum.rb +1 -1
- data/lib/puppet/provider/parsedfile.rb +1 -1
- data/lib/puppet/provider/service/daemontools.rb +9 -9
- data/lib/puppet/provider/service/openbsd.rb +1 -1
- data/lib/puppet/provider/service/rcng.rb +2 -2
- data/lib/puppet/provider/service/runit.rb +2 -8
- data/lib/puppet/provider/service/systemd.rb +10 -10
- data/lib/puppet/provider/user/directoryservice.rb +1 -1
- data/lib/puppet/provider/user/user_role_add.rb +1 -1
- data/lib/puppet/provider/user/useradd.rb +22 -13
- data/lib/puppet/provider/user/windows_adsi.rb +4 -5
- data/lib/puppet/reference/indirection.rb +2 -2
- data/lib/puppet/reference/metaparameter.rb +1 -3
- data/lib/puppet/reference/providers.rb +1 -1
- data/lib/puppet/reference/type.rb +3 -9
- data/lib/puppet/reports.rb +1 -1
- data/lib/puppet/resource.rb +1 -1
- data/lib/puppet/resource/catalog.rb +1 -1
- data/lib/puppet/rest/errors.rb +1 -0
- data/lib/puppet/rest/response.rb +1 -0
- data/lib/puppet/rest/route.rb +1 -0
- data/lib/puppet/rest/routes.rb +3 -0
- data/lib/puppet/runtime.rb +25 -0
- data/lib/puppet/settings.rb +3 -3
- data/lib/puppet/settings/environment_conf.rb +1 -0
- data/lib/puppet/ssl/host.rb +1 -1
- data/lib/puppet/ssl/oids.rb +1 -1
- data/lib/puppet/ssl/state_machine.rb +23 -15
- data/lib/puppet/test/test_helper.rb +1 -1
- data/lib/puppet/transaction/report.rb +1 -1
- data/lib/puppet/trusted_external.rb +13 -0
- data/lib/puppet/type.rb +1 -3
- data/lib/puppet/type/exec.rb +7 -3
- data/lib/puppet/type/file.rb +1 -2
- data/lib/puppet/type/file/source.rb +2 -2
- data/lib/puppet/type/package.rb +10 -3
- data/lib/puppet/type/schedule.rb +1 -1
- data/lib/puppet/type/service.rb +1 -1
- data/lib/puppet/util.rb +2 -2
- data/lib/puppet/util/command_line/trollop.rb +1 -1
- data/lib/puppet/util/http_proxy.rb +2 -10
- data/lib/puppet/util/log.rb +2 -2
- data/lib/puppet/util/log/destinations.rb +2 -2
- data/lib/puppet/util/logging.rb +2 -2
- data/lib/puppet/util/metric.rb +2 -2
- data/lib/puppet/util/platform.rb +15 -4
- data/lib/puppet/util/provider_features.rb +2 -4
- data/lib/puppet/util/rdoc.rb +1 -1
- data/lib/puppet/util/reference.rb +1 -1
- data/lib/puppet/util/resource_template.rb +1 -1
- data/lib/puppet/util/selinux.rb +3 -1
- data/lib/puppet/util/windows/registry.rb +7 -5
- data/lib/puppet/vendor.rb +1 -1
- data/lib/puppet/vendor/require_vendored.rb +0 -1
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet/x509/cert_provider.rb +4 -1
- data/locales/puppet.pot +279 -203
- data/man/man5/puppet.conf.5 +30 -8
- data/man/man8/puppet-agent.8 +4 -1
- data/man/man8/puppet-apply.8 +1 -1
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-config.8 +1 -1
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +1 -1
- 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 +1 -1
- data/man/man8/puppet-status.8 +1 -1
- data/man/man8/puppet.8 +2 -2
- data/spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-installed.txt +11 -0
- data/spec/integration/configurer_spec.rb +52 -0
- data/spec/lib/puppet/certificate_factory.rb +2 -2
- data/spec/spec_helper.rb +24 -0
- data/spec/unit/application/device_spec.rb +6 -0
- data/spec/unit/application/ssl_spec.rb +4 -7
- data/spec/unit/configurer_spec.rb +1 -0
- data/spec/unit/context/trusted_information_spec.rb +41 -2
- data/spec/unit/http/client_spec.rb +440 -0
- data/spec/unit/http/resolver_spec.rb +45 -0
- data/spec/unit/http/service/ca_spec.rb +106 -0
- data/spec/unit/http/service_spec.rb +32 -0
- data/spec/unit/http/session_spec.rb +102 -0
- data/spec/unit/indirector/resource/ral_spec.rb +4 -4
- data/spec/unit/network/http/connection_spec.rb +119 -145
- data/spec/unit/network/http/site_spec.rb +7 -0
- data/spec/unit/parser/scope_spec.rb +10 -0
- data/spec/unit/pops/loaders/loaders_spec.rb +13 -2
- data/spec/unit/pops/loaders/module_loaders_spec.rb +37 -0
- data/spec/unit/provider/exec_spec.rb +209 -0
- data/spec/unit/provider/package/dnfmodule_spec.rb +186 -0
- data/spec/unit/provider/package/dpkg_spec.rb +238 -78
- data/spec/unit/provider/package/pip_spec.rb +51 -6
- data/spec/unit/provider/service/daemontools_spec.rb +24 -0
- data/spec/unit/provider/service/runit_spec.rb +24 -0
- data/spec/unit/provider/service/systemd_spec.rb +25 -25
- data/spec/unit/provider/user/useradd_spec.rb +46 -0
- data/spec/unit/ssl/host_spec.rb +0 -5
- data/spec/unit/ssl/state_machine_spec.rb +16 -10
- data/spec/unit/type/exec_spec.rb +6 -12
- data/spec/unit/type/file_spec.rb +9 -4
- data/spec/unit/type/package_spec.rb +5 -0
- data/spec/unit/util/execution_spec.rb +16 -0
- data/spec/unit/util/http_proxy_spec.rb +79 -27
- data/spec/unit/util/log/destinations_spec.rb +7 -3
- metadata +54 -25
- data/lib/puppet/pops/loader/null_loader.rb +0 -60
- data/lib/puppet/vendor/deep_merge/CHANGELOG +0 -45
- data/lib/puppet/vendor/deep_merge/Gemfile +0 -3
- data/lib/puppet/vendor/deep_merge/LICENSE +0 -21
- data/lib/puppet/vendor/deep_merge/PUPPET_README.md +0 -6
- data/lib/puppet/vendor/deep_merge/README.md +0 -113
- data/lib/puppet/vendor/deep_merge/Rakefile +0 -19
- data/lib/puppet/vendor/deep_merge/deep_merge.gemspec +0 -35
- data/lib/puppet/vendor/deep_merge/lib/deep_merge.rb +0 -2
- data/lib/puppet/vendor/deep_merge/lib/deep_merge/core.rb +0 -210
- data/lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb +0 -28
- data/lib/puppet/vendor/deep_merge/lib/deep_merge/rails_compat.rb +0 -27
- data/lib/puppet/vendor/deep_merge/test/test_deep_merge.rb +0 -608
- data/lib/puppet/vendor/load_deep_merge.rb +0 -1
- data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_get/should_yield_to_the_block.yml +0 -24
- data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_head/should_yield_to_the_block.yml +0 -24
- data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_post/should_yield_to_the_block.yml +0 -24
@@ -375,6 +375,11 @@ describe Puppet::Type.type(:package) do
|
|
375
375
|
expect(pkg[:allow_virtual]).to eq true
|
376
376
|
end
|
377
377
|
|
378
|
+
it "defaults to false on dpkg provider" do
|
379
|
+
pkg = Puppet::Type.type(:package).new(:name => 'yay', :provider => :dpkg)
|
380
|
+
expect(pkg[:allow_virtual]).to be_nil
|
381
|
+
end
|
382
|
+
|
378
383
|
it "defaults to false on platforms that do not support virtual packages" do
|
379
384
|
pkg = Puppet::Type.type(:package).new(:name => 'yay', :provider => :apple)
|
380
385
|
expect(pkg[:allow_virtual]).to be_nil
|
@@ -128,6 +128,13 @@ describe Puppet::Util::Execution, if: !Puppet::Util::Platform.jruby? do
|
|
128
128
|
|
129
129
|
call_exec_posix('test command', { :cwd => cwd }, @stdin, @stdout, @stderr)
|
130
130
|
end
|
131
|
+
|
132
|
+
it "should not change the current working directory if cwd is unspecified" do
|
133
|
+
expect(Dir).to receive(:chdir).never
|
134
|
+
expect(Kernel).to receive(:exec).with('test command')
|
135
|
+
|
136
|
+
call_exec_posix('test command', {}, @stdin, @stdout, @stderr)
|
137
|
+
end
|
131
138
|
end
|
132
139
|
|
133
140
|
it "should return the pid of the child process" do
|
@@ -171,6 +178,15 @@ describe Puppet::Util::Execution, if: !Puppet::Util::Platform.jruby? do
|
|
171
178
|
|
172
179
|
call_exec_windows('test command', { :cwd => cwd }, @stdin, @stdout, @stderr)
|
173
180
|
end
|
181
|
+
|
182
|
+
it "should not change the current working directory if cwd is unspecified" do
|
183
|
+
expect(Dir).to receive(:chdir).never
|
184
|
+
expect(Process).to receive(:create) do |args|
|
185
|
+
expect(args[:cwd]).to be_nil
|
186
|
+
end
|
187
|
+
|
188
|
+
call_exec_windows('test command', {}, @stdin, @stdout, @stderr)
|
189
|
+
end
|
174
190
|
end
|
175
191
|
|
176
192
|
context 'suppress_window option' do
|
@@ -60,6 +60,64 @@ describe Puppet::Util::HttpProxy do
|
|
60
60
|
expects_direct_connection_to(http, www)
|
61
61
|
end
|
62
62
|
end
|
63
|
+
|
64
|
+
context 'when setting no_proxy' do
|
65
|
+
before :each do
|
66
|
+
Puppet[:http_proxy_host] = host
|
67
|
+
Puppet[:http_proxy_port] = port
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'connects directly to the server when HTTP_PROXY environment variable is set, but server matches no_proxy setting' do
|
71
|
+
Puppet[:no_proxy] = www.host
|
72
|
+
|
73
|
+
Puppet::Util.withenv('HTTP_PROXY' => "http://#{host}:#{port}") do
|
74
|
+
http = subject.proxy(www)
|
75
|
+
expects_direct_connection_to(http, www)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
it 'connects directly to the server when no_proxy matches wildcard domain' do
|
80
|
+
Puppet[:no_proxy] = '*.example.com'
|
81
|
+
|
82
|
+
http = subject.proxy(www)
|
83
|
+
expects_direct_connection_to(http, www)
|
84
|
+
end
|
85
|
+
|
86
|
+
it 'connects directly to the server when no_proxy matches dotted domain' do
|
87
|
+
Puppet[:no_proxy] = '.example.com'
|
88
|
+
|
89
|
+
http = subject.proxy(www)
|
90
|
+
expects_direct_connection_to(http, www)
|
91
|
+
end
|
92
|
+
|
93
|
+
it 'connects directly to the server when no_proxy matches a domain suffix like ruby does' do
|
94
|
+
Puppet[:no_proxy] = 'example.com'
|
95
|
+
|
96
|
+
http = subject.proxy(www)
|
97
|
+
expects_direct_connection_to(http, www)
|
98
|
+
end
|
99
|
+
|
100
|
+
it 'connects directly to the server when no_proxy matches a partial suffix like ruby does' do
|
101
|
+
Puppet[:no_proxy] = 'ample.com'
|
102
|
+
|
103
|
+
http = subject.proxy(www)
|
104
|
+
expects_direct_connection_to(http, www)
|
105
|
+
end
|
106
|
+
|
107
|
+
it 'connects directly to the server when it is a subdomain of no_proxy' do
|
108
|
+
Puppet[:no_proxy] = '*.com'
|
109
|
+
|
110
|
+
http = subject.proxy(www)
|
111
|
+
expects_direct_connection_to(http, www)
|
112
|
+
end
|
113
|
+
|
114
|
+
it 'connects directly to the server when no_proxy is *' do
|
115
|
+
Puppet[:no_proxy] = '*'
|
116
|
+
|
117
|
+
http = subject.proxy(www)
|
118
|
+
expects_direct_connection_to(http, www)
|
119
|
+
end
|
120
|
+
end
|
63
121
|
end
|
64
122
|
|
65
123
|
describe ".http_proxy_env" do
|
@@ -291,22 +349,22 @@ describe Puppet::Util::HttpProxy do
|
|
291
349
|
|
292
350
|
describe '.request_with_redirects' do
|
293
351
|
let(:dest) { URI.parse('http://mydomain.com/some/path') }
|
294
|
-
let(:http_ok) { double('http ok', :code => 200, :message => 'HTTP OK') }
|
295
352
|
|
296
353
|
it 'generates accept and accept-encoding headers' do
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
354
|
+
stub_request(:head, dest)
|
355
|
+
|
356
|
+
headers = {
|
357
|
+
'Accept' => '*/*',
|
358
|
+
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
359
|
+
'User-Agent' => /Puppet/
|
360
|
+
}
|
361
|
+
stub_request(:get, dest).with(headers: headers)
|
304
362
|
|
305
363
|
subject.request_with_redirects(dest, :get, 0)
|
306
364
|
end
|
307
365
|
|
308
366
|
it 'can return a compressed response body' do
|
309
|
-
|
367
|
+
stub_request(:head, dest)
|
310
368
|
|
311
369
|
compressed_body = [
|
312
370
|
0x1f, 0x8b, 0x08, 0x08, 0xe9, 0x08, 0x7a, 0x5a, 0x00, 0x03,
|
@@ -314,9 +372,7 @@ describe Puppet::Util::HttpProxy do
|
|
314
372
|
0x00, 0x7a, 0x7a, 0x6f, 0xed, 0x03, 0x00, 0x00, 0x00
|
315
373
|
].pack('C*')
|
316
374
|
|
317
|
-
|
318
|
-
allow(response).to receive(:[]).with('content-encoding').and_return('gzip')
|
319
|
-
expect_any_instance_of(Net::HTTP).to receive(:get).and_return(response)
|
375
|
+
stub_request(:get, dest).to_return(status: 200, body: compressed_body, headers: { 'Content-Encoding' => 'gzip' })
|
320
376
|
|
321
377
|
expect(
|
322
378
|
uncompress_body(subject.request_with_redirects(dest, :get, 0))
|
@@ -324,13 +380,14 @@ describe Puppet::Util::HttpProxy do
|
|
324
380
|
end
|
325
381
|
|
326
382
|
it 'generates accept and accept-encoding headers when a block is provided' do
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
383
|
+
stub_request(:head, dest)
|
384
|
+
|
385
|
+
headers = {
|
386
|
+
'Accept' => '*/*',
|
387
|
+
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
388
|
+
'User-Agent' => /Puppet/
|
389
|
+
}
|
390
|
+
stub_request(:get, dest).with(headers: headers)
|
334
391
|
|
335
392
|
subject.request_with_redirects(dest, :get, 0) do
|
336
393
|
# unused
|
@@ -338,7 +395,7 @@ describe Puppet::Util::HttpProxy do
|
|
338
395
|
end
|
339
396
|
|
340
397
|
it 'only makes a single HEAD request' do
|
341
|
-
|
398
|
+
stub_request(:head, dest)
|
342
399
|
|
343
400
|
subject.request_with_redirects(dest, :head, 0)
|
344
401
|
end
|
@@ -346,13 +403,8 @@ describe Puppet::Util::HttpProxy do
|
|
346
403
|
it 'preserves query parameters' do
|
347
404
|
url = URI.parse('http://mydomain.com/some/path?foo=bar')
|
348
405
|
|
349
|
-
|
350
|
-
|
351
|
-
end.and_return(http_ok)
|
352
|
-
|
353
|
-
expect_any_instance_of(Net::HTTP).to receive(:request_get) do |_http, path, _headers, &block|
|
354
|
-
expect(path).to eq(url)
|
355
|
-
end.and_return(http_ok)
|
406
|
+
stub_request(:head, url)
|
407
|
+
stub_request(:get, url)
|
356
408
|
|
357
409
|
subject.request_with_redirects(url, :get, 0) do
|
358
410
|
# unused
|
@@ -46,13 +46,15 @@ describe Puppet::Util::Log.desttypes[:file] do
|
|
46
46
|
|
47
47
|
describe "on POSIX systems", :if => Puppet.features.posix? do
|
48
48
|
describe "with a normal file" do
|
49
|
+
let (:parent) { Pathname.new('/tmp') }
|
49
50
|
let (:abspath) { '/tmp/log' }
|
50
51
|
let (:relpath) { 'log' }
|
51
52
|
|
52
53
|
it_behaves_like "file destination"
|
53
54
|
|
54
55
|
it "logs an error if it can't chown the file owner & group" do
|
55
|
-
|
56
|
+
allow(File).to receive(:exist?).with(parent).and_return(true)
|
57
|
+
expect(File).to receive(:exist?).with(Pathname.new(abspath)).and_return(false)
|
56
58
|
expect(FileUtils).to receive(:chown).with(Puppet[:user], Puppet[:group], abspath).and_raise(Errno::EPERM)
|
57
59
|
expect(Puppet.features).to receive(:root?).and_return(true)
|
58
60
|
expect(Puppet).to receive(:err).with("Unable to set ownership to #{Puppet[:user]}:#{Puppet[:group]} for log file: #{abspath}")
|
@@ -61,7 +63,8 @@ describe Puppet::Util::Log.desttypes[:file] do
|
|
61
63
|
end
|
62
64
|
|
63
65
|
it "doesn't attempt to chown when running as non-root" do
|
64
|
-
|
66
|
+
allow(File).to receive(:exist?).with(parent).and_return(true)
|
67
|
+
expect(File).to receive(:exist?).with(Pathname.new(abspath)).and_return(false)
|
65
68
|
expect(FileUtils).not_to receive(:chown).with(Puppet[:user], Puppet[:group], abspath)
|
66
69
|
expect(Puppet.features).to receive(:root?).and_return(false)
|
67
70
|
|
@@ -69,7 +72,8 @@ describe Puppet::Util::Log.desttypes[:file] do
|
|
69
72
|
end
|
70
73
|
|
71
74
|
it "doesn't attempt to chown when file already exists" do
|
72
|
-
|
75
|
+
allow(File).to receive(:exist?).with(parent).and_return(true)
|
76
|
+
expect(File).to receive(:exist?).with(Pathname.new(abspath)).and_return(true)
|
73
77
|
expect(FileUtils).not_to receive(:chown).with(Puppet[:user], Puppet[:group], abspath)
|
74
78
|
expect(Puppet.features).to receive(:root?).and_return(true)
|
75
79
|
|
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.
|
4
|
+
version: 6.11.0
|
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: 2019-
|
11
|
+
date: 2019-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facter
|
@@ -149,19 +149,39 @@ dependencies:
|
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: '1.0'
|
151
151
|
- !ruby/object:Gem::Dependency
|
152
|
-
name:
|
152
|
+
name: deep_merge
|
153
153
|
requirement: !ruby/object:Gem::Requirement
|
154
154
|
requirements:
|
155
155
|
- - "~>"
|
156
156
|
- !ruby/object:Gem::Version
|
157
|
-
version: 1.
|
157
|
+
version: '1.0'
|
158
158
|
type: :runtime
|
159
159
|
prerelease: false
|
160
160
|
version_requirements: !ruby/object:Gem::Requirement
|
161
161
|
requirements:
|
162
162
|
- - "~>"
|
163
163
|
- !ruby/object:Gem::Version
|
164
|
-
version: 1.
|
164
|
+
version: '1.0'
|
165
|
+
- !ruby/object:Gem::Dependency
|
166
|
+
name: ffi
|
167
|
+
requirement: !ruby/object:Gem::Requirement
|
168
|
+
requirements:
|
169
|
+
- - ">"
|
170
|
+
- !ruby/object:Gem::Version
|
171
|
+
version: 1.9.24
|
172
|
+
- - "<"
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: '2'
|
175
|
+
type: :runtime
|
176
|
+
prerelease: false
|
177
|
+
version_requirements: !ruby/object:Gem::Requirement
|
178
|
+
requirements:
|
179
|
+
- - ">"
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: 1.9.24
|
182
|
+
- - "<"
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
version: '2'
|
165
185
|
- !ruby/object:Gem::Dependency
|
166
186
|
name: win32-dir
|
167
187
|
requirement: !ruby/object:Gem::Requirement
|
@@ -624,6 +644,18 @@ files:
|
|
624
644
|
- lib/puppet/graph/relationship_graph.rb
|
625
645
|
- lib/puppet/graph/sequential_prioritizer.rb
|
626
646
|
- lib/puppet/graph/simple_graph.rb
|
647
|
+
- lib/puppet/http.rb
|
648
|
+
- lib/puppet/http/client.rb
|
649
|
+
- lib/puppet/http/errors.rb
|
650
|
+
- lib/puppet/http/redirector.rb
|
651
|
+
- lib/puppet/http/resolver.rb
|
652
|
+
- lib/puppet/http/resolver/settings.rb
|
653
|
+
- lib/puppet/http/resolver/srv.rb
|
654
|
+
- lib/puppet/http/response.rb
|
655
|
+
- lib/puppet/http/retry_after_handler.rb
|
656
|
+
- lib/puppet/http/service.rb
|
657
|
+
- lib/puppet/http/service/ca.rb
|
658
|
+
- lib/puppet/http/session.rb
|
627
659
|
- lib/puppet/indirector.rb
|
628
660
|
- lib/puppet/indirector/catalog/compiler.rb
|
629
661
|
- lib/puppet/indirector/catalog/json.rb
|
@@ -922,7 +954,6 @@ files:
|
|
922
954
|
- lib/puppet/pops/loader/loader.rb
|
923
955
|
- lib/puppet/pops/loader/loader_paths.rb
|
924
956
|
- lib/puppet/pops/loader/module_loaders.rb
|
925
|
-
- lib/puppet/pops/loader/null_loader.rb
|
926
957
|
- lib/puppet/pops/loader/predefined_loader.rb
|
927
958
|
- lib/puppet/pops/loader/puppet_function_instantiator.rb
|
928
959
|
- lib/puppet/pops/loader/puppet_plan_instantiator.rb
|
@@ -1090,6 +1121,7 @@ files:
|
|
1090
1121
|
- lib/puppet/provider/package/aptrpm.rb
|
1091
1122
|
- lib/puppet/provider/package/blastwave.rb
|
1092
1123
|
- lib/puppet/provider/package/dnf.rb
|
1124
|
+
- lib/puppet/provider/package/dnfmodule.rb
|
1093
1125
|
- lib/puppet/provider/package/dpkg.rb
|
1094
1126
|
- lib/puppet/provider/package/fink.rb
|
1095
1127
|
- lib/puppet/provider/package/freebsd.rb
|
@@ -1177,6 +1209,7 @@ files:
|
|
1177
1209
|
- lib/puppet/rest/response.rb
|
1178
1210
|
- lib/puppet/rest/route.rb
|
1179
1211
|
- lib/puppet/rest/routes.rb
|
1212
|
+
- lib/puppet/runtime.rb
|
1180
1213
|
- lib/puppet/scheduler.rb
|
1181
1214
|
- lib/puppet/scheduler/job.rb
|
1182
1215
|
- lib/puppet/scheduler/scheduler.rb
|
@@ -1240,6 +1273,7 @@ files:
|
|
1240
1273
|
- lib/puppet/transaction/persistence.rb
|
1241
1274
|
- lib/puppet/transaction/report.rb
|
1242
1275
|
- lib/puppet/transaction/resource_harness.rb
|
1276
|
+
- lib/puppet/trusted_external.rb
|
1243
1277
|
- lib/puppet/type.rb
|
1244
1278
|
- lib/puppet/type/component.rb
|
1245
1279
|
- lib/puppet/type/exec.rb
|
@@ -1382,19 +1416,6 @@ files:
|
|
1382
1416
|
- lib/puppet/util/windows/user.rb
|
1383
1417
|
- lib/puppet/util/yaml.rb
|
1384
1418
|
- lib/puppet/vendor.rb
|
1385
|
-
- lib/puppet/vendor/deep_merge/CHANGELOG
|
1386
|
-
- lib/puppet/vendor/deep_merge/Gemfile
|
1387
|
-
- lib/puppet/vendor/deep_merge/LICENSE
|
1388
|
-
- lib/puppet/vendor/deep_merge/PUPPET_README.md
|
1389
|
-
- lib/puppet/vendor/deep_merge/README.md
|
1390
|
-
- lib/puppet/vendor/deep_merge/Rakefile
|
1391
|
-
- lib/puppet/vendor/deep_merge/deep_merge.gemspec
|
1392
|
-
- lib/puppet/vendor/deep_merge/lib/deep_merge.rb
|
1393
|
-
- lib/puppet/vendor/deep_merge/lib/deep_merge/core.rb
|
1394
|
-
- lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb
|
1395
|
-
- lib/puppet/vendor/deep_merge/lib/deep_merge/rails_compat.rb
|
1396
|
-
- lib/puppet/vendor/deep_merge/test/test_deep_merge.rb
|
1397
|
-
- lib/puppet/vendor/load_deep_merge.rb
|
1398
1419
|
- lib/puppet/vendor/load_pathspec.rb
|
1399
1420
|
- lib/puppet/vendor/pathspec/CHANGELOG.md
|
1400
1421
|
- lib/puppet/vendor/pathspec/LICENSE
|
@@ -1765,6 +1786,7 @@ files:
|
|
1765
1786
|
- spec/fixtures/unit/provider/cron/crontab/vixie_header.txt
|
1766
1787
|
- spec/fixtures/unit/provider/cron/parsed/managed
|
1767
1788
|
- spec/fixtures/unit/provider/cron/parsed/simple
|
1789
|
+
- spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-installed.txt
|
1768
1790
|
- spec/fixtures/unit/provider/package/gem/gem-list-single-package
|
1769
1791
|
- spec/fixtures/unit/provider/package/gem/line-with-1.8.5-warning
|
1770
1792
|
- spec/fixtures/unit/provider/package/openbsd/pkginfo.detail
|
@@ -1816,9 +1838,6 @@ files:
|
|
1816
1838
|
- spec/fixtures/unit/util/filetype/suntab_output
|
1817
1839
|
- spec/fixtures/unit/util/monkey_patches/x509.pem
|
1818
1840
|
- spec/fixtures/unit/util/rdoc/basic.pp
|
1819
|
-
- spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_get/should_yield_to_the_block.yml
|
1820
|
-
- spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_head/should_yield_to_the_block.yml
|
1821
|
-
- spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_post/should_yield_to_the_block.yml
|
1822
1841
|
- spec/fixtures/vcr/cassettes/Puppet_Type_File/when_sourcing/from_http/using_md5/should_fetch_if_not_on_the_local_disk.yml
|
1823
1842
|
- spec/fixtures/vcr/cassettes/Puppet_Type_File/when_sourcing/from_http/using_md5/should_not_update_if_content_on_disk_is_up-to-date.yml
|
1824
1843
|
- spec/fixtures/vcr/cassettes/Puppet_Type_File/when_sourcing/from_http/using_md5/should_update_if_content_differs_on_disk.yml
|
@@ -2135,6 +2154,11 @@ files:
|
|
2135
2154
|
- spec/unit/graph/simple_graph_spec.rb
|
2136
2155
|
- spec/unit/hiera/scope_spec.rb
|
2137
2156
|
- spec/unit/hiera_puppet_spec.rb
|
2157
|
+
- spec/unit/http/client_spec.rb
|
2158
|
+
- spec/unit/http/resolver_spec.rb
|
2159
|
+
- spec/unit/http/service/ca_spec.rb
|
2160
|
+
- spec/unit/http/service_spec.rb
|
2161
|
+
- spec/unit/http/session_spec.rb
|
2138
2162
|
- spec/unit/indirector/catalog/compiler_spec.rb
|
2139
2163
|
- spec/unit/indirector/catalog/json_spec.rb
|
2140
2164
|
- spec/unit/indirector/catalog/msgpack_spec.rb
|
@@ -2424,6 +2448,7 @@ files:
|
|
2424
2448
|
- spec/unit/provider/package/aptrpm_spec.rb
|
2425
2449
|
- spec/unit/provider/package/base_spec.rb
|
2426
2450
|
- spec/unit/provider/package/dnf_spec.rb
|
2451
|
+
- spec/unit/provider/package/dnfmodule_spec.rb
|
2427
2452
|
- spec/unit/provider/package/dpkg_spec.rb
|
2428
2453
|
- spec/unit/provider/package/freebsd_spec.rb
|
2429
2454
|
- spec/unit/provider/package/gem_spec.rb
|
@@ -3010,6 +3035,7 @@ test_files:
|
|
3010
3035
|
- spec/fixtures/unit/provider/cron/crontab/vixie_header.txt
|
3011
3036
|
- spec/fixtures/unit/provider/cron/parsed/managed
|
3012
3037
|
- spec/fixtures/unit/provider/cron/parsed/simple
|
3038
|
+
- spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-installed.txt
|
3013
3039
|
- spec/fixtures/unit/provider/package/gem/gem-list-single-package
|
3014
3040
|
- spec/fixtures/unit/provider/package/gem/line-with-1.8.5-warning
|
3015
3041
|
- spec/fixtures/unit/provider/package/openbsd/pkginfo.detail
|
@@ -3061,9 +3087,6 @@ test_files:
|
|
3061
3087
|
- spec/fixtures/unit/util/filetype/suntab_output
|
3062
3088
|
- spec/fixtures/unit/util/monkey_patches/x509.pem
|
3063
3089
|
- spec/fixtures/unit/util/rdoc/basic.pp
|
3064
|
-
- spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_get/should_yield_to_the_block.yml
|
3065
|
-
- spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_head/should_yield_to_the_block.yml
|
3066
|
-
- spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_post/should_yield_to_the_block.yml
|
3067
3090
|
- spec/fixtures/vcr/cassettes/Puppet_Type_File/when_sourcing/from_http/using_md5/should_fetch_if_not_on_the_local_disk.yml
|
3068
3091
|
- spec/fixtures/vcr/cassettes/Puppet_Type_File/when_sourcing/from_http/using_md5/should_not_update_if_content_on_disk_is_up-to-date.yml
|
3069
3092
|
- spec/fixtures/vcr/cassettes/Puppet_Type_File/when_sourcing/from_http/using_md5/should_update_if_content_differs_on_disk.yml
|
@@ -3380,6 +3403,11 @@ test_files:
|
|
3380
3403
|
- spec/unit/graph/simple_graph_spec.rb
|
3381
3404
|
- spec/unit/hiera/scope_spec.rb
|
3382
3405
|
- spec/unit/hiera_puppet_spec.rb
|
3406
|
+
- spec/unit/http/client_spec.rb
|
3407
|
+
- spec/unit/http/resolver_spec.rb
|
3408
|
+
- spec/unit/http/service/ca_spec.rb
|
3409
|
+
- spec/unit/http/service_spec.rb
|
3410
|
+
- spec/unit/http/session_spec.rb
|
3383
3411
|
- spec/unit/indirector/catalog/compiler_spec.rb
|
3384
3412
|
- spec/unit/indirector/catalog/json_spec.rb
|
3385
3413
|
- spec/unit/indirector/catalog/msgpack_spec.rb
|
@@ -3669,6 +3697,7 @@ test_files:
|
|
3669
3697
|
- spec/unit/provider/package/aptrpm_spec.rb
|
3670
3698
|
- spec/unit/provider/package/base_spec.rb
|
3671
3699
|
- spec/unit/provider/package/dnf_spec.rb
|
3700
|
+
- spec/unit/provider/package/dnfmodule_spec.rb
|
3672
3701
|
- spec/unit/provider/package/dpkg_spec.rb
|
3673
3702
|
- spec/unit/provider/package/freebsd_spec.rb
|
3674
3703
|
- spec/unit/provider/package/gem_spec.rb
|
@@ -1,60 +0,0 @@
|
|
1
|
-
# The null loader is empty and delegates everything to its parent if it has one.
|
2
|
-
#
|
3
|
-
class Puppet::Pops::Loader::NullLoader < Puppet::Pops::Loader::Loader
|
4
|
-
attr_reader :loader_name
|
5
|
-
|
6
|
-
# Construct a NullLoader, optionally with a parent loader
|
7
|
-
#
|
8
|
-
def initialize(parent_loader=nil, loader_name = "null-loader")
|
9
|
-
super(loader_name)
|
10
|
-
@parent = parent_loader
|
11
|
-
end
|
12
|
-
|
13
|
-
# Has parent if one was set when constructed
|
14
|
-
def parent
|
15
|
-
@parent
|
16
|
-
end
|
17
|
-
|
18
|
-
def find(typed_name)
|
19
|
-
if @parent.nil?
|
20
|
-
nil
|
21
|
-
else
|
22
|
-
@parent.find(typed_name)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def load_typed(typed_name)
|
27
|
-
if @parent.nil?
|
28
|
-
nil
|
29
|
-
else
|
30
|
-
@parent.load_typed(typed_name)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
def loaded_entry(typed_name, check_dependencies = false)
|
35
|
-
if @parent.nil?
|
36
|
-
nil
|
37
|
-
else
|
38
|
-
@parent.loaded_entry(typed_name, check_dependencies)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
# Has no entries on its own - always nil
|
43
|
-
def get_entry(typed_name)
|
44
|
-
nil
|
45
|
-
end
|
46
|
-
|
47
|
-
# Finds nothing, there are no entries
|
48
|
-
def find(name)
|
49
|
-
nil
|
50
|
-
end
|
51
|
-
|
52
|
-
# Cannot store anything
|
53
|
-
def set_entry(typed_name, value, origin = nil)
|
54
|
-
nil
|
55
|
-
end
|
56
|
-
|
57
|
-
def to_s()
|
58
|
-
"(NullLoader '#{loader_name}')"
|
59
|
-
end
|
60
|
-
end
|