puppet 6.8.1-universal-darwin → 6.9.0-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 (93) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -1
  3. data/Gemfile.lock +10 -11
  4. data/ext/project_data.yaml +1 -0
  5. data/lib/puppet.rb +9 -1
  6. data/lib/puppet/application/agent.rb +12 -0
  7. data/lib/puppet/application_support.rb +1 -1
  8. data/lib/puppet/context.rb +120 -48
  9. data/lib/puppet/face/config.rb +10 -48
  10. data/lib/puppet/face/help.rb +1 -1
  11. data/lib/puppet/face/plugin.rb +9 -2
  12. data/lib/puppet/forge/repository.rb +1 -1
  13. data/lib/puppet/functions/regsubst.rb +58 -37
  14. data/lib/puppet/indirector/catalog/compiler.rb +10 -6
  15. data/lib/puppet/module_tool/applications/uninstaller.rb +2 -3
  16. data/lib/puppet/network/http/connection.rb +1 -1
  17. data/lib/puppet/network/http/factory.rb +1 -1
  18. data/lib/puppet/network/http_pool.rb +1 -0
  19. data/lib/puppet/provider/package/dnf.rb +1 -1
  20. data/lib/puppet/provider/package/rpm.rb +51 -13
  21. data/lib/puppet/provider/package/yum.rb +8 -4
  22. data/lib/puppet/provider/service/systemd.rb +1 -1
  23. data/lib/puppet/settings.rb +40 -0
  24. data/lib/puppet/ssl.rb +1 -1
  25. data/lib/puppet/ssl/base.rb +1 -1
  26. data/lib/puppet/ssl/openssl_loader.rb +28 -0
  27. data/lib/puppet/ssl/validator.rb +1 -1
  28. data/lib/puppet/ssl/validator/default_validator.rb +1 -1
  29. data/lib/puppet/ssl/validator/no_validator.rb +1 -1
  30. data/lib/puppet/thread_local.rb +7 -0
  31. data/lib/puppet/type/exec.rb +14 -6
  32. data/lib/puppet/type/group.rb +4 -2
  33. data/lib/puppet/type/package.rb +10 -0
  34. data/lib/puppet/type/user.rb +4 -2
  35. data/lib/puppet/util/checksums.rb +3 -3
  36. data/lib/puppet/util/http_proxy.rb +8 -6
  37. data/lib/puppet/util/monkey_patches.rb +53 -47
  38. data/lib/puppet/util/platform.rb +16 -0
  39. data/lib/puppet/util/ssl.rb +1 -1
  40. data/lib/puppet/util/windows/root_certs.rb +1 -1
  41. data/lib/puppet/version.rb +1 -1
  42. data/lib/puppet/x509.rb +1 -1
  43. data/locales/puppet.pot +119 -119
  44. data/man/man5/puppet.conf.5 +2 -2
  45. data/man/man8/puppet-agent.8 +1 -1
  46. data/man/man8/puppet-apply.8 +1 -1
  47. data/man/man8/puppet-catalog.8 +1 -1
  48. data/man/man8/puppet-config.8 +1 -1
  49. data/man/man8/puppet-describe.8 +1 -1
  50. data/man/man8/puppet-device.8 +1 -1
  51. data/man/man8/puppet-doc.8 +1 -1
  52. data/man/man8/puppet-epp.8 +1 -1
  53. data/man/man8/puppet-facts.8 +1 -1
  54. data/man/man8/puppet-filebucket.8 +1 -1
  55. data/man/man8/puppet-generate.8 +1 -1
  56. data/man/man8/puppet-help.8 +1 -1
  57. data/man/man8/puppet-key.8 +1 -1
  58. data/man/man8/puppet-lookup.8 +1 -1
  59. data/man/man8/puppet-man.8 +1 -1
  60. data/man/man8/puppet-module.8 +1 -1
  61. data/man/man8/puppet-node.8 +1 -1
  62. data/man/man8/puppet-parser.8 +1 -1
  63. data/man/man8/puppet-plugin.8 +1 -1
  64. data/man/man8/puppet-report.8 +1 -1
  65. data/man/man8/puppet-resource.8 +1 -1
  66. data/man/man8/puppet-script.8 +1 -1
  67. data/man/man8/puppet-ssl.8 +1 -1
  68. data/man/man8/puppet-status.8 +1 -1
  69. data/man/man8/puppet.8 +3 -3
  70. data/spec/integration/provider/service/systemd_spec.rb +7 -6
  71. data/spec/integration/util/execution_spec.rb +1 -1
  72. data/spec/lib/puppet_spec/matchers.rb +0 -13
  73. data/spec/spec_helper.rb +1 -3
  74. data/spec/unit/application/agent_spec.rb +19 -0
  75. data/spec/unit/context_spec.rb +119 -38
  76. data/spec/unit/face/help_spec.rb +1 -1
  77. data/spec/unit/face/plugin_spec.rb +8 -0
  78. data/spec/unit/forge/forge_spec.rb +1 -3
  79. data/spec/unit/forge/repository_spec.rb +1 -3
  80. data/spec/unit/functions/contain_spec.rb +1 -1
  81. data/spec/unit/indirector/catalog/compiler_spec.rb +62 -5
  82. data/spec/unit/module_tool/applications/uninstaller_spec.rb +16 -7
  83. data/spec/unit/node/environment_spec.rb +1 -1
  84. data/spec/unit/provider/package/aptrpm_spec.rb +1 -1
  85. data/spec/unit/provider/package/dnf_spec.rb +7 -0
  86. data/spec/unit/provider/package/pkgin_spec.rb +1 -1
  87. data/spec/unit/provider/package/rpm_spec.rb +150 -16
  88. data/spec/unit/provider/package/yum_spec.rb +7 -0
  89. data/spec/unit/type/exec_spec.rb +9 -0
  90. data/spec/unit/type/schedule_spec.rb +1 -1
  91. data/spec/unit/util/http_proxy_spec.rb +50 -0
  92. data/spec/unit/util/inifile_spec.rb +5 -5
  93. metadata +18 -2
@@ -64,6 +64,13 @@ describe Puppet::Type.type(:package).provider(:yum) do
64
64
 
65
65
  before { allow(described_class).to receive(:command).with(:cmd).and_return("/usr/bin/yum") }
66
66
 
67
+ describe 'provider features' do
68
+ it { is_expected.to be_versionable }
69
+ it { is_expected.to be_install_options }
70
+ it { is_expected.to be_virtual_packages }
71
+ it { is_expected.to be_install_only }
72
+ end
73
+
67
74
  context "when installing" do
68
75
  it "should use the supplied source as the explicit path to a package to install" do
69
76
  resource[:ensure] = :present
@@ -771,6 +771,15 @@ RSpec.describe Puppet::Type.type(:exec) do
771
771
  expect(@test.check_all_attributes).to eq(true)
772
772
  expect(@logs.shift.message).to eq("test output")
773
773
  end
774
+
775
+ it "should not emit output to debug if sensitive is true" do
776
+ Puppet::Util::Log.level = :debug
777
+ @test[param] = @fail
778
+ allow(@test.parameters[param]).to receive(:sensitive).and_return(true)
779
+ expect(@test.check_all_attributes).to eq(true)
780
+ expect(@logs).not_to include(an_object_having_attributes(level: :debug, message: "test output"))
781
+ expect(@logs).to include(an_object_having_attributes(level: :debug, message: "[output redacted]"))
782
+ end
774
783
  end
775
784
  end
776
785
  end
@@ -63,7 +63,7 @@ describe Puppet::Type.type(:schedule) do
63
63
  it "should not produce default schedules when default_schedules is false" do
64
64
  Puppet[:default_schedules] = false
65
65
  schedules = Puppet::Type.type(:schedule).mkdefaultschedules
66
- expect(schedules).to have_exactly(0).items
66
+ expect(schedules).to be_empty
67
67
  end
68
68
 
69
69
  it "should produce a schedule named puppet with a period of hourly and a repeat of 2" do
@@ -12,6 +12,56 @@ describe Puppet::Util::HttpProxy do
12
12
 
13
13
  host, port, user, password = 'some.host', 1234, 'user1', 'pAssw0rd'
14
14
 
15
+ def expects_direct_connection_to(http, www)
16
+ expect(http.address).to eq(www.host)
17
+ expect(http.port).to eq(www.port)
18
+
19
+ expect(http.proxy_address).to be_nil
20
+ expect(http.proxy_port).to be_nil
21
+ expect(http.proxy_user).to be_nil
22
+ expect(http.proxy_pass).to be_nil
23
+ end
24
+
25
+ def expects_proxy_connection_via(http, www, host, port, user, password)
26
+ expect(http.address).to eq(www.host)
27
+ expect(http.port).to eq(www.port)
28
+
29
+ expect(http.proxy_address).to eq(host)
30
+ expect(http.proxy_port).to eq(port)
31
+ expect(http.proxy_user).to eq(user)
32
+ expect(http.proxy_pass).to eq(password)
33
+ end
34
+
35
+ describe '.proxy' do
36
+ let(:www) { URI::HTTP.build(host: 'www.example.com', port: 80) }
37
+
38
+ it 'uses a proxy' do
39
+ Puppet[:http_proxy_host] = host
40
+ Puppet[:http_proxy_port] = port
41
+ Puppet[:http_proxy_user] = user
42
+ Puppet[:http_proxy_password] = password
43
+
44
+ http = subject.proxy(www)
45
+ expects_proxy_connection_via(http, www, host, port, user, password)
46
+ end
47
+
48
+ it 'connects directly to the server' do
49
+ http = subject.proxy(www)
50
+ expects_direct_connection_to(http, www)
51
+ end
52
+
53
+ it 'connects directly to the server when HTTP_PROXY environment variable is set, but server matches no_proxy setting' do
54
+ Puppet[:http_proxy_host] = host
55
+ Puppet[:http_proxy_port] = port
56
+ Puppet[:no_proxy] = www.host
57
+
58
+ Puppet::Util.withenv('HTTP_PROXY' => "http://#{host}:#{port}") do
59
+ http = subject.proxy(www)
60
+ expects_direct_connection_to(http, www)
61
+ end
62
+ end
63
+ end
64
+
15
65
  describe ".http_proxy_env" do
16
66
  it "should return nil if no environment variables" do
17
67
  expect(subject.http_proxy_env).to eq(nil)
@@ -132,7 +132,7 @@ describe Puppet::Util::IniConfig::PhysicalFile do
132
132
 
133
133
  subject.parse(text)
134
134
 
135
- expect(subject.contents).to have(1).items
135
+ expect(subject.contents.count).to eq 1
136
136
  sect = subject.contents[0]
137
137
  expect(sect.name).to eq "mysect"
138
138
  end
@@ -171,7 +171,7 @@ describe Puppet::Util::IniConfig::PhysicalFile do
171
171
  text = "[main]\nkey=val\n"
172
172
 
173
173
  subject.parse(text)
174
- expect(subject.contents).to have(1).items
174
+ expect(subject.contents.count).to eq 1
175
175
  sect = subject.contents[0]
176
176
  expect(sect['key']).to eq 'val'
177
177
  end
@@ -186,7 +186,7 @@ white_space_after_equals= value3
186
186
  white_space_after_value=value4\t
187
187
  INIFILE
188
188
  subject.parse(text)
189
- expect(subject.contents).to have(1).items
189
+ expect(subject.contents.count).to eq 1
190
190
  subject.contents[0]
191
191
  end
192
192
 
@@ -213,7 +213,7 @@ INIFILE
213
213
  text = "[main]\nkey=val\n moreval"
214
214
 
215
215
  subject.parse(text)
216
- expect(subject.contents).to have(1).items
216
+ expect(subject.contents.count).to eq 1
217
217
  sect = subject.contents[0]
218
218
  expect(sect['key']).to eq "val\n moreval"
219
219
  end
@@ -261,7 +261,7 @@ INIFILE
261
261
  subject.parse(text)
262
262
 
263
263
  sections = subject.sections
264
- expect(sections).to have(2).items
264
+ expect(sections.count).to eq 2
265
265
  expect(sections[0].name).to eq "first"
266
266
  expect(sections[1].name).to eq "second"
267
267
  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.8.1
4
+ version: 6.9.0
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: 2019-08-27 00:00:00.000000000 Z
11
+ date: 2019-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facter
@@ -134,6 +134,20 @@ dependencies:
134
134
  - - "~>"
135
135
  - !ruby/object:Gem::Version
136
136
  version: '1.5'
137
+ - !ruby/object:Gem::Dependency
138
+ name: concurrent-ruby
139
+ requirement: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - "~>"
142
+ - !ruby/object:Gem::Version
143
+ version: '1.0'
144
+ type: :runtime
145
+ prerelease: false
146
+ version_requirements: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - "~>"
149
+ - !ruby/object:Gem::Version
150
+ version: '1.0'
137
151
  - !ruby/object:Gem::Dependency
138
152
  name: CFPropertyList
139
153
  requirement: !ruby/object:Gem::Requirement
@@ -1131,6 +1145,7 @@ files:
1131
1145
  - lib/puppet/ssl/host.rb
1132
1146
  - lib/puppet/ssl/key.rb
1133
1147
  - lib/puppet/ssl/oids.rb
1148
+ - lib/puppet/ssl/openssl_loader.rb
1134
1149
  - lib/puppet/ssl/ssl_context.rb
1135
1150
  - lib/puppet/ssl/ssl_provider.rb
1136
1151
  - lib/puppet/ssl/state_machine.rb
@@ -1146,6 +1161,7 @@ files:
1146
1161
  - lib/puppet/syntax_checkers/json.rb
1147
1162
  - lib/puppet/syntax_checkers/pp.rb
1148
1163
  - lib/puppet/test/test_helper.rb
1164
+ - lib/puppet/thread_local.rb
1149
1165
  - lib/puppet/transaction.rb
1150
1166
  - lib/puppet/transaction/additional_resource_generator.rb
1151
1167
  - lib/puppet/transaction/event.rb