puppet 5.5.16-x86-mingw32 → 5.5.17-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.

Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/CODEOWNERS +9 -9
  3. data/Gemfile.lock +18 -18
  4. data/ext/project_data.yaml +2 -2
  5. data/install.rb +3 -21
  6. data/lib/puppet/application/agent.rb +12 -0
  7. data/lib/puppet/application/device.rb +4 -4
  8. data/lib/puppet/application/resource.rb +4 -4
  9. data/lib/puppet/defaults.rb +4 -0
  10. data/lib/puppet/face/config.rb +10 -48
  11. data/lib/puppet/face/facts.rb +1 -1
  12. data/lib/puppet/face/plugin.rb +9 -2
  13. data/lib/puppet/module_tool/tar/mini.rb +11 -1
  14. data/lib/puppet/network/http/factory.rb +1 -11
  15. data/lib/puppet/parameter.rb +8 -0
  16. data/lib/puppet/provider/file/posix.rb +5 -0
  17. data/lib/puppet/provider/nameservice.rb +10 -3
  18. data/lib/puppet/provider/package/dnf.rb +1 -1
  19. data/lib/puppet/provider/package/rpm.rb +51 -13
  20. data/lib/puppet/provider/package/yum.rb +8 -4
  21. data/lib/puppet/provider/service/launchd.rb +20 -5
  22. data/lib/puppet/provider/service/systemd.rb +4 -9
  23. data/lib/puppet/provider/service/windows.rb +8 -0
  24. data/lib/puppet/provider/user/pw.rb +12 -3
  25. data/lib/puppet/provider/user/user_role_add.rb +4 -0
  26. data/lib/puppet/provider/user/useradd.rb +23 -7
  27. data/lib/puppet/resource.rb +17 -0
  28. data/lib/puppet/settings.rb +40 -0
  29. data/lib/puppet/type.rb +7 -0
  30. data/lib/puppet/type/exec.rb +14 -6
  31. data/lib/puppet/type/package.rb +10 -0
  32. data/lib/puppet/type/service.rb +7 -2
  33. data/lib/puppet/type/user.rb +1 -15
  34. data/lib/puppet/type/yumrepo.rb +3 -7
  35. data/lib/puppet/util/execution.rb +4 -3
  36. data/lib/puppet/util/http_proxy.rb +16 -2
  37. data/lib/puppet/util/selinux.rb +5 -1
  38. data/lib/puppet/util/windows/security.rb +2 -0
  39. data/lib/puppet/util/windows/service.rb +149 -4
  40. data/lib/puppet/util/windows/sid.rb +1 -0
  41. data/lib/puppet/version.rb +1 -1
  42. data/locales/puppet.pot +189 -193
  43. data/man/man5/puppet.conf.5 +10 -2
  44. data/man/man8/puppet-agent.8 +1 -1
  45. data/man/man8/puppet-apply.8 +1 -1
  46. data/man/man8/puppet-ca.8 +1 -1
  47. data/man/man8/puppet-catalog.8 +1 -1
  48. data/man/man8/puppet-cert.8 +1 -1
  49. data/man/man8/puppet-certificate.8 +1 -1
  50. data/man/man8/puppet-certificate_request.8 +1 -1
  51. data/man/man8/puppet-certificate_revocation_list.8 +1 -1
  52. data/man/man8/puppet-config.8 +1 -1
  53. data/man/man8/puppet-describe.8 +1 -1
  54. data/man/man8/puppet-device.8 +1 -1
  55. data/man/man8/puppet-doc.8 +1 -1
  56. data/man/man8/puppet-epp.8 +1 -1
  57. data/man/man8/puppet-facts.8 +1 -1
  58. data/man/man8/puppet-filebucket.8 +1 -1
  59. data/man/man8/puppet-generate.8 +1 -1
  60. data/man/man8/puppet-help.8 +1 -1
  61. data/man/man8/puppet-key.8 +1 -1
  62. data/man/man8/puppet-lookup.8 +1 -1
  63. data/man/man8/puppet-man.8 +1 -1
  64. data/man/man8/puppet-master.8 +1 -1
  65. data/man/man8/puppet-module.8 +1 -1
  66. data/man/man8/puppet-node.8 +1 -1
  67. data/man/man8/puppet-parser.8 +1 -1
  68. data/man/man8/puppet-plugin.8 +1 -1
  69. data/man/man8/puppet-report.8 +1 -1
  70. data/man/man8/puppet-resource.8 +1 -1
  71. data/man/man8/puppet-script.8 +1 -1
  72. data/man/man8/puppet-status.8 +1 -1
  73. data/man/man8/puppet.8 +2 -2
  74. data/spec/integration/provider/service/systemd_spec.rb +8 -5
  75. data/spec/integration/type/file_spec.rb +28 -0
  76. data/spec/integration/util/execution_spec.rb +27 -0
  77. data/spec/unit/application/agent_spec.rb +18 -0
  78. data/spec/unit/application/device_spec.rb +1 -1
  79. data/spec/unit/face/facts_spec.rb +9 -0
  80. data/spec/unit/face/plugin_spec.rb +8 -0
  81. data/spec/unit/module_tool/tar/mini_spec.rb +1 -1
  82. data/spec/unit/network/http/api/indirected_routes_spec.rb +26 -10
  83. data/spec/unit/network/http/factory_spec.rb +27 -5
  84. data/spec/unit/pops/validator/validator_spec.rb +7 -0
  85. data/spec/unit/provider/package/aptrpm_spec.rb +1 -1
  86. data/spec/unit/provider/package/dnf_spec.rb +7 -0
  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/provider/service/launchd_spec.rb +28 -0
  90. data/spec/unit/provider/service/windows_spec.rb +20 -0
  91. data/spec/unit/provider/user/pw_spec.rb +37 -0
  92. data/spec/unit/provider/user/useradd_spec.rb +42 -0
  93. data/spec/unit/resource_spec.rb +26 -1
  94. data/spec/unit/transaction_spec.rb +18 -0
  95. data/spec/unit/type/exec_spec.rb +9 -0
  96. data/spec/unit/type/file/source_spec.rb +4 -4
  97. data/spec/unit/type/schedule_spec.rb +3 -1
  98. data/spec/unit/type/service_spec.rb +16 -0
  99. data/spec/unit/type/user_spec.rb +13 -13
  100. data/spec/unit/type/yumrepo_spec.rb +30 -0
  101. data/spec/unit/type_spec.rb +40 -0
  102. data/spec/unit/util/http_proxy_spec.rb +24 -1
  103. data/spec/unit/util/log_spec.rb +27 -1
  104. data/spec/unit/util/windows/service_spec.rb +9 -0
  105. metadata +5 -9
  106. data/ext/windows/eventlog/Rakefile +0 -32
  107. data/ext/windows/eventlog/puppetres.dll +0 -0
  108. data/ext/windows/eventlog/puppetres.mc +0 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cff13ff3f6751769d2e6449bf4d5cde342a42ea110e806478ae4a7c5a9fd70e4
4
- data.tar.gz: e402b10a351f587f5a6bb51ca8a76ed592de9b91f78cb48686033231b23cc7ff
3
+ metadata.gz: ee6d24c8f1efdc7dc1c9f70069feb76b7326114587b7d422673a619b1aa757a5
4
+ data.tar.gz: e22ff9442673e6298c6e092ec6f0a7f785a4edfe88626adb1cfa1ab560640f68
5
5
  SHA512:
6
- metadata.gz: ac35185ead33adbbcc018e73f5370e6299cc2223f0202cbe5214b090d5c2adcaaaa22a0c0e885c47b26a187a980117dd78283fbd6c7675b8d2d8c166da8a51e2
7
- data.tar.gz: 590e1d9a1262a9b4b2f7784a92fc56f380327af7377da800918b63ccaeb3a1bcb35520ba0a56adf9fdb81974b5292464f0c7b61c813f723c1ac7ad7abf9abb0f
6
+ metadata.gz: 208b63292f6fb85492c8141c1382916bfc0941ddb5bfcae661fb3fd5830d13e0c09a9c4609b287d47c1fb41fb98a22edfcd446c7e84f2da2c456dc6cb3dd5c70
7
+ data.tar.gz: e4144a37224f6fc362c759072f050e265e62ba379887428107ca98d19105d8d715f08009ed541e51f01d7762d643f21a9657607007e1cdd0a72bd1a6af305c90
data/CODEOWNERS CHANGED
@@ -1,15 +1,15 @@
1
1
  # default to platform-core
2
2
  * @puppetlabs/platform-core
3
3
 
4
- # platform-os
5
- /lib/puppet/type/group @puppetlabs/platform-os
6
- /lib/puppet/type/package @puppetlabs/platform-os
7
- /lib/puppet/type/service @puppetlabs/platform-os
8
- /lib/puppet/type/user @puppetlabs/platform-os
9
- /lib/puppet/provider/group @puppetlabs/platform-os
10
- /lib/puppet/provider/package @puppetlabs/platform-os
11
- /lib/puppet/provider/service @puppetlabs/platform-os
12
- /lib/puppet/provider/user @puppetlabs/platform-os
4
+ # Night's Watch
5
+ /lib/puppet/type/group @puppetlabs/night-s-watch
6
+ /lib/puppet/type/package @puppetlabs/night-s-watch
7
+ /lib/puppet/type/service @puppetlabs/night-s-watch
8
+ /lib/puppet/type/user @puppetlabs/night-s-watch
9
+ /lib/puppet/provider/group @puppetlabs/night-s-watch
10
+ /lib/puppet/provider/package @puppetlabs/night-s-watch
11
+ /lib/puppet/provider/service @puppetlabs/night-s-watch
12
+ /lib/puppet/provider/user @puppetlabs/night-s-watch
13
13
 
14
14
  # language
15
15
  /lib/puppet/datatypes @puppetlabs/language
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- puppet (5.5.16)
4
+ puppet (5.5.17)
5
5
  CFPropertyList (~> 2.2)
6
6
  facter (>= 2.4.0, < 4)
7
7
  fast_gettext (~> 1.1.2)
@@ -23,12 +23,12 @@ GEM
23
23
  crack (0.4.3)
24
24
  safe_yaml (~> 1.0.0)
25
25
  diff-lcs (1.3)
26
- facter (2.5.1)
26
+ facter (2.5.6)
27
27
  fast_gettext (1.1.2)
28
28
  gettext (3.2.9)
29
29
  locale (>= 2.0.5)
30
30
  text (>= 1.3.0)
31
- gettext-setup (0.30)
31
+ gettext-setup (0.31)
32
32
  fast_gettext (~> 1.1.0)
33
33
  gettext (>= 3.0.2)
34
34
  locale
@@ -48,16 +48,16 @@ GEM
48
48
  method_source (0.9.2)
49
49
  mocha (1.9.0)
50
50
  metaclass (~> 0.0.1)
51
- msgpack (1.3.0)
51
+ msgpack (1.3.1)
52
52
  multi_json (1.13.1)
53
53
  mustache (1.1.0)
54
54
  net-ssh (4.2.0)
55
55
  optimist (3.0.0)
56
- packaging (0.99.36)
56
+ packaging (0.99.44)
57
57
  artifactory (~> 2)
58
- rake (~> 12.3)
59
- parallel (1.17.0)
60
- parser (2.6.3.0)
58
+ rake (>= 12.3)
59
+ parallel (1.18.0)
60
+ parser (2.6.5.0)
61
61
  ast (~> 2.4.0)
62
62
  pathspec (0.2.1)
63
63
  powerpack (0.1.2)
@@ -65,7 +65,7 @@ GEM
65
65
  coderay (~> 1.1.0)
66
66
  method_source (~> 0.9.0)
67
67
  puppet-lint (2.3.6)
68
- puppet-syntax (2.5.0)
68
+ puppet-syntax (2.6.0)
69
69
  rake
70
70
  puppetlabs_spec_helper (2.14.1)
71
71
  mocha (~> 1.0)
@@ -76,7 +76,7 @@ GEM
76
76
  racc (1.4.9)
77
77
  rack (1.6.11)
78
78
  rainbow (2.1.0)
79
- rake (12.3.2)
79
+ rake (12.3.3)
80
80
  rdiscount (2.2.0.1)
81
81
  rdoc (4.3.0)
82
82
  redcarpet (2.3.0)
@@ -88,24 +88,24 @@ GEM
88
88
  rspec-core (~> 3.8.0)
89
89
  rspec-expectations (~> 3.8.0)
90
90
  rspec-mocks (~> 3.8.0)
91
- rspec-collection_matchers (1.1.3)
91
+ rspec-collection_matchers (1.2.0)
92
92
  rspec-expectations (>= 2.99.0.beta1)
93
93
  rspec-core (3.8.2)
94
94
  rspec-support (~> 3.8.0)
95
- rspec-expectations (3.8.4)
95
+ rspec-expectations (3.8.5)
96
96
  diff-lcs (>= 1.2.0, < 2.0)
97
97
  rspec-support (~> 3.8.0)
98
98
  rspec-its (1.3.0)
99
99
  rspec-core (>= 3.0.0)
100
100
  rspec-expectations (>= 3.0.0)
101
- rspec-legacy_formatters (1.0.1)
101
+ rspec-legacy_formatters (1.0.2)
102
102
  rspec (~> 3.0)
103
- rspec-mocks (3.8.1)
103
+ rspec-mocks (3.8.2)
104
104
  diff-lcs (>= 1.2.0, < 2.0)
105
105
  rspec-support (~> 3.8.0)
106
- rspec-puppet (2.7.5)
106
+ rspec-puppet (2.7.7)
107
107
  rspec
108
- rspec-support (3.8.2)
108
+ rspec-support (3.8.3)
109
109
  rubocop (0.49.1)
110
110
  parallel (~> 1.10)
111
111
  parser (>= 2.3.3.1, < 3.0)
@@ -115,7 +115,7 @@ GEM
115
115
  unicode-display_width (~> 1.0, >= 1.0.1)
116
116
  rubocop-i18n (1.2.0)
117
117
  rubocop (~> 0.49.0)
118
- ruby-prof (0.18.0)
118
+ ruby-prof (1.0.0)
119
119
  ruby-progressbar (1.10.1)
120
120
  safe_yaml (1.0.5)
121
121
  text (1.3.1)
@@ -165,4 +165,4 @@ DEPENDENCIES
165
165
  yarjuf (~> 2.0)
166
166
 
167
167
  BUNDLED WITH
168
- 1.16.5
168
+ 1.17.3
@@ -45,7 +45,7 @@ gem_platform_dependencies:
45
45
  # Use of win32-security is deprecated
46
46
  win32-security: '= 0.2.5'
47
47
  win32-service: '= 0.8.8'
48
- minitar: '~> 0.6.1'
48
+ minitar: '~> 0.9'
49
49
  x64-mingw32:
50
50
  gem_runtime_dependencies:
51
51
  # ffi is pinned due to PUP-8438
@@ -56,7 +56,7 @@ gem_platform_dependencies:
56
56
  # Use of win32-security is deprecated
57
57
  win32-security: '= 0.2.5'
58
58
  win32-service: '= 0.8.8'
59
- minitar: '~> 0.6.1'
59
+ minitar: '~> 0.9'
60
60
  bundle_platforms:
61
61
  universal-darwin: all
62
62
  x86-mingw32: mingw
data/install.rb CHANGED
@@ -62,24 +62,6 @@ def do_configs(configs, target, strip = 'conf/')
62
62
  ocf = File.join(InstallOptions.config_dir, cf.gsub(/#{strip}/, ''))
63
63
  FileUtils.install(cf, ocf, {:mode => 0644, :preserve => true, :verbose => true})
64
64
  end
65
-
66
- if $operatingsystem == 'windows'
67
- src_dll = 'ext/windows/eventlog/puppetres.dll'
68
- dst_dll = File.join(InstallOptions.bin_dir, 'puppetres.dll')
69
- FileUtils.install(src_dll, dst_dll, {:mode => 0644, :preserve => true, :verbose => true})
70
-
71
- require 'win32/registry'
72
- include Win32::Registry::Constants
73
-
74
- begin
75
- Win32::Registry::HKEY_LOCAL_MACHINE.create('SYSTEM\CurrentControlSet\services\eventlog\Application\Puppet', KEY_ALL_ACCESS | 0x0100) do |reg|
76
- reg.write_s('EventMessageFile', dst_dll.tr('/', '\\'))
77
- reg.write_i('TypesSupported', 0x7)
78
- end
79
- rescue Win32::Registry::Error => e
80
- warn "Failed to create puppet eventlog registry key: #{e}"
81
- end
82
- end
83
65
  end
84
66
 
85
67
  def do_bins(bins, target, strip = 's?bin/')
@@ -140,12 +122,12 @@ def check_prereqs
140
122
  facter_version = Facter.version.to_f
141
123
  if facter_version < MIN_FACTER_VERSION
142
124
  puts "Facter version: #{facter_version}; minimum required: #{MIN_FACTER_VERSION}; cannot install"
143
- exit -1
125
+ exit (-1)
144
126
  end
145
127
  end
146
128
  rescue LoadError
147
129
  puts "Could not load #{pre}; cannot install"
148
- exit -1
130
+ exit (-1)
149
131
  end
150
132
  }
151
133
  end
@@ -266,7 +248,7 @@ def prepare_installation
266
248
  require 'win32/dir'
267
249
  rescue LoadError => e
268
250
  puts "Cannot run on Microsoft Windows without the win32-process, win32-dir & win32-service gems: #{e}"
269
- exit -1
251
+ exit (-1)
270
252
  end
271
253
  end
272
254
 
@@ -344,6 +344,8 @@ Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License
344
344
  # Setup signal traps immediately after daemonization so we clean up the daemon
345
345
  daemon.set_signal_traps
346
346
 
347
+ log_config if Puppet[:daemonize]
348
+
347
349
  wait_for_certificates
348
350
 
349
351
  if Puppet[:onetime]
@@ -354,6 +356,16 @@ Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License
354
356
  end
355
357
  end
356
358
 
359
+ def log_config
360
+ #skip also config reading and parsing if debug is not enabled
361
+ return unless Puppet::Util::Log.sendlevel?(:debug)
362
+
363
+ Puppet.settings.stringify_settings(:agent, :all).each_pair do |k,v|
364
+ next if k.include?("password") || v.to_s.empty?
365
+ Puppet.debug("Using setting: #{k}=#{v}")
366
+ end
367
+ end
368
+
357
369
  def fingerprint
358
370
  host = Puppet::SSL::Host.new
359
371
  unless cert = host.certificate || host.certificate_request
@@ -297,10 +297,10 @@ Licensed under the Apache 2.0 License
297
297
  Puppet.info _("retrieving resource: %{resource} from %{target} at %{scheme}%{url_host}%{port}%{url_path}") % { resource: type, target: device.name, scheme: scheme, url_host: device_url.host, port: port, url_path: device_url.path }
298
298
  resources = find_resources(type, name)
299
299
  if options[:to_yaml]
300
- text = resources.map do |resource|
301
- resource.prune_parameters(:parameters_to_include => @extra_params).to_hierayaml.force_encoding(Encoding.default_external)
302
- end.join("\n")
303
- text.prepend("#{type.downcase}:\n")
300
+ data = resources.map do |resource|
301
+ resource.prune_parameters(:parameters_to_include => @extra_params).to_hiera_hash
302
+ end.inject(:merge!)
303
+ text = YAML.dump(type.downcase => data)
304
304
  else
305
305
  text = resources.map do |resource|
306
306
  resource.prune_parameters(:parameters_to_include => @extra_params).to_manifest.force_encoding(Encoding.default_external)
@@ -142,10 +142,10 @@ Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License
142
142
  resources = find_or_save_resources(type, name, params)
143
143
 
144
144
  if options[:to_yaml]
145
- text = resources.map do |resource|
146
- resource.prune_parameters(:parameters_to_include => @extra_params).to_hierayaml.force_encoding(Encoding.default_external)
147
- end.join("\n")
148
- text.prepend("#{type.downcase}:\n")
145
+ data = resources.map do |resource|
146
+ resource.prune_parameters(:parameters_to_include => @extra_params).to_hiera_hash
147
+ end.inject(:merge!)
148
+ text = YAML.dump(type.downcase => data)
149
149
  else
150
150
  text = resources.map do |resource|
151
151
  resource.prune_parameters(:parameters_to_include => @extra_params).to_manifest.force_encoding(Encoding.default_external)
@@ -550,6 +550,10 @@ module Puppet
550
550
  contains any characters with special meanings in URLs (as specified by RFC 3986
551
551
  section 2.2), they must be URL-encoded. (For example, `#` would become `%23`.)",
552
552
  },
553
+ :no_proxy => {
554
+ :default => "localhost, 127.0.0.1",
555
+ :desc => "List of domain names that should not go through `http_proxy_host`. Environment variable no_proxy or NO_PROXY will override this value.",
556
+ },
553
557
  :http_keepalive_timeout => {
554
558
  :default => "4s",
555
559
  :type => :duration,
@@ -66,41 +66,18 @@ Puppet::Face.define(:config, '0.0.1') do
66
66
  @default_section = true
67
67
  end
68
68
 
69
- render_all_settings = args.empty? || args == ['all']
70
-
71
- args = Puppet.settings.to_a.collect(&:first) if render_all_settings
72
-
73
- values_from_the_selected_section =
74
- Puppet.settings.values(nil, options[:section].to_sym)
75
-
76
- loader_settings = {
77
- :environmentpath => values_from_the_selected_section.interpolate(:environmentpath),
78
- :basemodulepath => values_from_the_selected_section.interpolate(:basemodulepath),
79
- }
80
-
81
- to_be_rendered = nil
82
- Puppet.override(Puppet.base_context(loader_settings),
83
- _("New environment loaders generated from the requested section.")) do
84
- # And now we can lookup values that include those from environments configured from
85
- # the requested section
86
- values = Puppet.settings.values(Puppet[:environment].to_sym, options[:section].to_sym)
87
-
88
- if Puppet::Util::Log.sendlevel?(:info)
89
- warn_default_section(options[:section]) if @default_section
90
- report_section_and_environment(options[:section], Puppet.settings[:environment])
91
- end
92
-
93
- to_be_rendered = {}
94
- args.sort.each do |setting_name|
95
- to_be_rendered[setting_name] = values.print(setting_name.to_sym)
96
- end
69
+ if Puppet::Util::Log.sendlevel?(:info)
70
+ warn_default_section(options[:section]) if @default_section
71
+ report_section_and_environment(options[:section], Puppet.settings[:environment])
97
72
  end
98
73
 
99
- # convert symbols to strings before formatting output
100
- if render_all_settings
101
- to_be_rendered = stringifyhash(to_be_rendered)
102
- end
103
- to_be_rendered
74
+ names = if args.empty? || args == ['all']
75
+ :all
76
+ else
77
+ args
78
+ end
79
+
80
+ Puppet.settings.stringify_settings(options[:section], names)
104
81
  end
105
82
 
106
83
  when_rendering :console do |to_be_rendered|
@@ -117,21 +94,6 @@ Puppet::Face.define(:config, '0.0.1') do
117
94
  end
118
95
  end
119
96
 
120
- def stringifyhash(hash)
121
- newhash = {}
122
- hash.each do |key, val|
123
- key = key.to_s
124
- if val.is_a? Hash
125
- newhash[key] = stringifyhash(val)
126
- elsif val.is_a? Symbol
127
- newhash[key] = val.to_s
128
- else
129
- newhash[key] = val
130
- end
131
- end
132
- newhash
133
- end
134
-
135
97
  def warn_default_section(section_name)
136
98
  messages = []
137
99
  messages << _("No section specified; defaulting to '%{section_name}'.") %
@@ -81,7 +81,7 @@ Puppet::Indirector::Face.define(:facts, '0.0.1') do
81
81
  node: Puppet[:node_name_value],
82
82
  server: server})
83
83
 
84
- Puppet::Node::Facts.indirection.save(facts)
84
+ Puppet::Node::Facts.indirection.save(facts, nil, :environment => Puppet.lookup(:current_environment))
85
85
  end
86
86
  end
87
87
  end
@@ -41,8 +41,15 @@ Puppet::Face.define(:plugin, '0.0.1') do
41
41
  when_invoked do |options|
42
42
  remote_environment_for_plugins = Puppet::Node::Environment.remote(Puppet[:environment])
43
43
 
44
- handler = Puppet::Configurer::PluginHandler.new()
45
- handler.download_plugins(remote_environment_for_plugins)
44
+ pool = Puppet::Network::HTTP::Pool.new(Puppet[:http_keepalive_timeout])
45
+ Puppet.override(:http_pool => pool) do
46
+ begin
47
+ handler = Puppet::Configurer::PluginHandler.new()
48
+ handler.download_plugins(remote_environment_for_plugins)
49
+ ensure
50
+ pool.close
51
+ end
52
+ end
46
53
  end
47
54
 
48
55
  when_rendering :console do |value|
@@ -1,7 +1,17 @@
1
1
  class Puppet::ModuleTool::Tar::Mini
2
2
  def unpack(sourcefile, destdir, _)
3
3
  Zlib::GzipReader.open(sourcefile) do |reader|
4
- Archive::Tar::Minitar.unpack(reader, destdir, find_valid_files(reader)) do |action, name, stats|
4
+ # puppet doesn't have a hard dependency on minitar, so we
5
+ # can't be certain which version is installed. If it's 0.9
6
+ # or above then we can prevent minitar from fsync'ing each
7
+ # extracted file and directory, otherwise fallback to the
8
+ # old behavior
9
+ args = [reader, destdir, find_valid_files(reader)]
10
+ spec = Gem::Specification.find_by_name('minitar')
11
+ if spec && spec.version >= Gem::Version.new('0.9')
12
+ args << {:fsync => false}
13
+ end
14
+ Archive::Tar::Minitar.unpack(*args) do |action, name, stats|
5
15
  case action
6
16
  when :dir
7
17
  validate_entry(destdir, name)
@@ -25,17 +25,7 @@ class Puppet::Network::HTTP::Factory
25
25
  def create_connection(site)
26
26
  Puppet.debug("Creating new connection for #{site}")
27
27
 
28
- args = [site.host, site.port]
29
-
30
- unless Puppet::Util::HttpProxy.no_proxy?(site)
31
- if Puppet[:http_proxy_host] == "none"
32
- args << nil << nil
33
- else
34
- args << Puppet[:http_proxy_host] << Puppet[:http_proxy_port]
35
- end
36
- end
37
-
38
- http = Net::HTTP.new(*args)
28
+ http = Puppet::Util::HttpProxy.proxy(URI(site.addr))
39
29
  http.use_ssl = site.use_ssl?
40
30
  http.read_timeout = Puppet[:http_read_timeout]
41
31
  http.open_timeout = Puppet[:http_connect_timeout]
@@ -93,6 +93,14 @@ class Puppet::Parameter
93
93
  end
94
94
  end
95
95
 
96
+ def sensitive(value = nil, &block)
97
+ if block
98
+ define_method(:is_sensitive, &block)
99
+ else
100
+ define_method(:is_sensitive) do value end
101
+ end
102
+ end
103
+
96
104
  # Produces a documentation string.
97
105
  # If an enumeration of _valid values_ has been defined, it is appended to the documentation
98
106
  # for this parameter specified with the {desc} method.
@@ -8,6 +8,11 @@ Puppet::Type.type(:file).provide :posix do
8
8
  include Puppet::Util::Warnings
9
9
 
10
10
  require 'etc'
11
+ require 'puppet/util/selinux'
12
+
13
+ def self.post_resource_eval
14
+ Selinux.matchpathcon_fini if Puppet::Util::SELinux.selinux_support?
15
+ end
11
16
 
12
17
  def uid2name(id)
13
18
  return id.to_s if id.is_a?(Symbol) or id.is_a?(String)