puppet 4.10.9-x64-mingw32 → 4.10.10-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.

Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/lib/puppet/agent.rb +22 -2
  3. data/lib/puppet/application.rb +18 -1
  4. data/lib/puppet/application/agent.rb +9 -2
  5. data/lib/puppet/application/apply.rb +1 -1
  6. data/lib/puppet/application/config.rb +1 -0
  7. data/lib/puppet/application/device.rb +1 -2
  8. data/lib/puppet/application/filebucket.rb +22 -5
  9. data/lib/puppet/application/help.rb +1 -0
  10. data/lib/puppet/application/inspect.rb +2 -0
  11. data/lib/puppet/application/lookup.rb +1 -3
  12. data/lib/puppet/application_support.rb +6 -1
  13. data/lib/puppet/defaults.rb +33 -4
  14. data/lib/puppet/face/config.rb +13 -0
  15. data/lib/puppet/functions/each.rb +10 -4
  16. data/lib/puppet/functions/lookup.rb +2 -2
  17. data/lib/puppet/functions/map.rb +12 -2
  18. data/lib/puppet/functions/reduce.rb +45 -2
  19. data/lib/puppet/interface.rb +1 -0
  20. data/lib/puppet/module_tool/tar/mini.rb +57 -4
  21. data/lib/puppet/network/http/factory.rb +9 -0
  22. data/lib/puppet/network/http/webrick.rb +1 -3
  23. data/lib/puppet/node.rb +10 -0
  24. data/lib/puppet/node/facts.rb +9 -0
  25. data/lib/puppet/parser/functions/sprintf.rb +17 -3
  26. data/lib/puppet/pops/loader/static_loader.rb +2 -2
  27. data/lib/puppet/pops/lookup/hiera_config.rb +2 -2
  28. data/lib/puppet/pops/merge_strategy.rb +16 -1
  29. data/lib/puppet/pops/types/iterable.rb +2 -0
  30. data/lib/puppet/pops/types/type_factory.rb +1 -1
  31. data/lib/puppet/pops/types/type_mismatch_describer.rb +15 -5
  32. data/lib/puppet/pops/types/types.rb +4 -2
  33. data/lib/puppet/provider/service/smf.rb +2 -2
  34. data/lib/puppet/provider/service/systemd.rb +1 -0
  35. data/lib/puppet/provider/service/upstart.rb +1 -1
  36. data/lib/puppet/settings/environment_conf.rb +10 -2
  37. data/lib/puppet/transaction.rb +3 -0
  38. data/lib/puppet/transaction/report.rb +8 -1
  39. data/lib/puppet/type.rb +1 -9
  40. data/lib/puppet/type/user.rb +9 -3
  41. data/lib/puppet/util/http_proxy.rb +14 -6
  42. data/lib/puppet/version.rb +1 -1
  43. data/locales/puppet.pot +29 -13
  44. data/man/man5/puppet.conf.5 +276 -55
  45. data/man/man8/extlookup2hiera.8 +2 -2
  46. data/man/man8/puppet-agent.8 +32 -10
  47. data/man/man8/puppet-apply.8 +21 -6
  48. data/man/man8/puppet-ca.8 +48 -34
  49. data/man/man8/puppet-catalog.8 +4 -4
  50. data/man/man8/puppet-cert.8 +23 -6
  51. data/man/man8/puppet-certificate.8 +44 -28
  52. data/man/man8/puppet-certificate_request.8 +4 -4
  53. data/man/man8/puppet-certificate_revocation_list.8 +4 -4
  54. data/man/man8/puppet-config.8 +5 -5
  55. data/man/man8/puppet-describe.8 +3 -3
  56. data/man/man8/puppet-device.8 +23 -13
  57. data/man/man8/puppet-doc.8 +5 -5
  58. data/man/man8/puppet-epp.8 +16 -10
  59. data/man/man8/puppet-facts.8 +4 -4
  60. data/man/man8/puppet-file.8 +4 -4
  61. data/man/man8/puppet-filebucket.8 +63 -6
  62. data/man/man8/puppet-generate.8 +84 -0
  63. data/man/man8/puppet-help.8 +4 -4
  64. data/man/man8/puppet-inspect.8 +8 -5
  65. data/man/man8/puppet-key.8 +4 -4
  66. data/man/man8/puppet-lookup.8 +87 -0
  67. data/man/man8/puppet-man.8 +5 -5
  68. data/man/man8/puppet-master.8 +5 -5
  69. data/man/man8/puppet-module.8 +22 -13
  70. data/man/man8/puppet-node.8 +4 -4
  71. data/man/man8/puppet-parser.8 +4 -4
  72. data/man/man8/puppet-plugin.8 +4 -4
  73. data/man/man8/puppet-report.8 +4 -4
  74. data/man/man8/puppet-resource.8 +4 -8
  75. data/man/man8/puppet-resource_type.8 +4 -4
  76. data/man/man8/puppet-status.8 +5 -5
  77. data/man/man8/puppet.8 +12 -3
  78. data/spec/fixtures/unit/application/environments/production/data/common.yaml +2 -0
  79. data/spec/integration/agent/logging_spec.rb +2 -0
  80. data/spec/integration/provider/cron/crontab_spec.rb +1 -0
  81. data/spec/unit/agent_spec.rb +33 -0
  82. data/spec/unit/application/config_spec.rb +4 -0
  83. data/spec/unit/application/inspect_spec.rb +11 -0
  84. data/spec/unit/application/lookup_spec.rb +30 -0
  85. data/spec/unit/application_spec.rb +18 -0
  86. data/spec/unit/environments_spec.rb +15 -0
  87. data/spec/unit/face/config_spec.rb +1 -2
  88. data/spec/unit/functions/break_spec.rb +108 -49
  89. data/spec/unit/functions/defined_spec.rb +2 -2
  90. data/spec/unit/functions/lookup_spec.rb +88 -3
  91. data/spec/unit/interface_spec.rb +12 -0
  92. data/spec/unit/module_tool/tar/mini_spec.rb +34 -5
  93. data/spec/unit/network/http/factory_spec.rb +22 -0
  94. data/spec/unit/network/http/webrick_spec.rb +30 -29
  95. data/spec/unit/parser/functions/sprintf_spec.rb +26 -0
  96. data/spec/unit/pops/loaders/static_loader_spec.rb +1 -1
  97. data/spec/unit/pops/types/type_calculator_spec.rb +21 -0
  98. data/spec/unit/pops/types/type_mismatch_describer_spec.rb +9 -0
  99. data/spec/unit/provider/service/smf_spec.rb +2 -4
  100. data/spec/unit/provider/service/systemd_spec.rb +14 -0
  101. data/spec/unit/resource/catalog_spec.rb +10 -0
  102. data/spec/unit/transaction/report_spec.rb +19 -0
  103. data/spec/unit/util/http_proxy_spec.rb +37 -0
  104. metadata +4 -2
@@ -182,6 +182,7 @@ class Puppet::Interface
182
182
  def to_s
183
183
  "Puppet::Face[#{name.inspect}, #{version.inspect}]"
184
184
  end
185
+ alias_method :inspect, :to_s
185
186
 
186
187
  # @return [void]
187
188
  def deprecate
@@ -3,24 +3,77 @@ class Puppet::ModuleTool::Tar::Mini
3
3
  Zlib::GzipReader.open(sourcefile) do |reader|
4
4
  Archive::Tar::Minitar.unpack(reader, destdir, find_valid_files(reader)) do |action, name, stats|
5
5
  case action
6
- when :file_done
7
- File.chmod(0644, "#{destdir}/#{name}")
8
- when :dir, :file_start
6
+ when :dir
9
7
  validate_entry(destdir, name)
8
+ set_dir_mode!(stats)
9
+ Puppet.debug("Extracting: #{destdir}/#{name}")
10
+ when :file_start
11
+ # Octal string of the old file mode.
12
+ validate_entry(destdir, name)
13
+ set_file_mode!(stats)
10
14
  Puppet.debug("Extracting: #{destdir}/#{name}")
11
15
  end
16
+ set_default_user_and_group!(stats)
17
+ stats
12
18
  end
13
19
  end
14
20
  end
15
21
 
16
22
  def pack(sourcedir, destfile)
17
23
  Zlib::GzipWriter.open(destfile) do |writer|
18
- Archive::Tar::Minitar.pack(sourcedir, writer)
24
+ Archive::Tar::Minitar.pack(sourcedir, writer) do |step, name, stats|
25
+ # TODO smcclellan 2017-10-31 Set permissions here when this yield block
26
+ # executes before the header is written. As it stands, the `stats`
27
+ # argument isn't mutable in a way that will effect the desired mode for
28
+ # the file.
29
+ end
19
30
  end
20
31
  end
21
32
 
22
33
  private
23
34
 
35
+ EXECUTABLE = 0755
36
+ NOT_EXECUTABLE = 0644
37
+ USER_EXECUTE = 0100
38
+
39
+ def set_dir_mode!(stats)
40
+ if stats.key?(:mode)
41
+ # This is only the case for `pack`, so this code will not run.
42
+ stats[:mode] = EXECUTABLE
43
+ elsif stats.key?(:entry)
44
+ old_mode = stats[:entry].instance_variable_get(:@mode)
45
+ if old_mode.is_a?(Fixnum)
46
+ stats[:entry].instance_variable_set(:@mode, EXECUTABLE)
47
+ end
48
+ end
49
+ end
50
+
51
+ # Sets a file mode to 0755 if the file is executable by the user.
52
+ # Sets a file mode to 0644 if the file mode is set (non-Windows).
53
+ def sanitized_mode(old_mode)
54
+ old_mode & USER_EXECUTE != 0 ? EXECUTABLE : NOT_EXECUTABLE
55
+ end
56
+
57
+ def set_file_mode!(stats)
58
+ if stats.key?(:mode)
59
+ # This is only the case for `pack`, so this code will not run.
60
+ stats[:mode] = sanitized_mode(stats[:mode])
61
+ elsif stats.key?(:entry)
62
+ old_mode = stats[:entry].instance_variable_get(:@mode)
63
+ # If the user can execute the file, set 0755, otherwise 0644.
64
+ if old_mode.is_a?(Fixnum)
65
+ new_mode = sanitized_mode(old_mode)
66
+ stats[:entry].instance_variable_set(:@mode, new_mode)
67
+ end
68
+ end
69
+ end
70
+
71
+ # Sets UID and GID to 0 for standardization.
72
+ def set_default_user_and_group!(stats)
73
+ stats[:uid] = 0
74
+ stats[:gid] = 0
75
+ end
76
+
24
77
  # Find all the valid files in tarfile.
25
78
  #
26
79
  # This check was mainly added to ignore 'x' and 'g' flags from the PAX
@@ -38,6 +38,15 @@ class Puppet::Network::HTTP::Factory
38
38
  http.read_timeout = Puppet[:http_read_timeout]
39
39
  http.open_timeout = Puppet[:http_connect_timeout]
40
40
 
41
+ if Puppet[:sourceaddress]
42
+ if http.respond_to?(:local_host)
43
+ Puppet.debug("Using source IP #{Puppet[:sourceaddress]}")
44
+ http.local_host = Puppet[:sourceaddress]
45
+ else
46
+ raise ArgumentError, "Setting 'sourceaddress' is unsupported by this version of Net::HTTP."
47
+ end
48
+ end
49
+
41
50
  if Puppet[:http_debug]
42
51
  http.set_debug_output($stderr)
43
52
  end
@@ -17,8 +17,6 @@ class Puppet::Network::HTTP::WEBrick
17
17
  def listen(address, port)
18
18
  @server = create_server(address, port)
19
19
 
20
- @server.listeners.each { |l| l.start_immediately = false }
21
-
22
20
  @server.mount('/', Puppet::Network::HTTP::WEBrickREST)
23
21
 
24
22
  raise "WEBrick server is already listening" if @listening
@@ -101,7 +99,7 @@ class Puppet::Network::HTTP::WEBrick
101
99
 
102
100
  results[:SSLPrivateKey] = host.key.content
103
101
  results[:SSLCertificate] = host.certificate.content
104
- results[:SSLStartImmediately] = true
102
+ results[:SSLStartImmediately] = false
105
103
  results[:SSLEnable] = true
106
104
  results[:SSLOptions] = OpenSSL::SSL::OP_NO_SSLv2 | OpenSSL::SSL::OP_NO_SSLv3
107
105
 
@@ -137,6 +137,16 @@ class Puppet::Node
137
137
  @parameters[ENVIRONMENT] ||= self.environment.name.to_s
138
138
  end
139
139
 
140
+ # Add extra facts, such as facts given to lookup on the command line The
141
+ # extra facts will override existing ones.
142
+ # @param extra_facts [Hash{String=>Object}] the facts to tadd
143
+ # @api private
144
+ def add_extra_facts(extra_facts)
145
+ @facts.add_extra_values(extra_facts)
146
+ @parameters.merge!(extra_facts)
147
+ nil
148
+ end
149
+
140
150
  def add_server_facts(facts)
141
151
  # Append the current environment to the list of server facts
142
152
  @server_facts = facts.merge({ "environment" => self.environment.name.to_s})
@@ -59,6 +59,15 @@ class Puppet::Node::Facts
59
59
  end
60
60
  end
61
61
 
62
+ # Add extra values, such as facts given to lookup on the command line. The
63
+ # extra values will override existing values.
64
+ # @param extra_values [Hash{String=>Object}] the values to add
65
+ # @api private
66
+ def add_extra_values(extra_values)
67
+ @values.merge!(extra_values)
68
+ nil
69
+ end
70
+
62
71
  # Sanitize fact values by converting everything not a string, Boolean
63
72
  # numeric, array or hash into strings.
64
73
  def sanitize
@@ -29,8 +29,22 @@ Puppet::Parser::Functions::newfunction(
29
29
  :arity => -2,
30
30
  :doc => "Perform printf-style formatting of text.
31
31
 
32
- The first parameter is format string describing how the rest of the parameters should be formatted. See the documentation for the `Kernel::sprintf` function in Ruby for all the details."
32
+ The first parameter is format string describing how the rest of the parameters should be formatted.
33
+ See the documentation for the `Kernel::sprintf` function in Ruby for all the details."
33
34
  ) do |args|
34
- fmt = args.shift
35
- return sprintf(fmt, *args)
35
+ fmt = args[0]
36
+ args = args[1..-1]
37
+ begin
38
+ return sprintf(fmt, *args)
39
+ rescue KeyError => e
40
+ if args.size == 1 && args[0].is_a?(Hash)
41
+ # map the single hash argument such that all top level string keys are symbols
42
+ # as that allows named arguments to be used in the format string.
43
+ #
44
+ result = {}
45
+ args[0].each_pair { |k,v| result[k.is_a?(String) ? k.to_sym : k] = v }
46
+ return sprintf(fmt, result)
47
+ end
48
+ raise e
49
+ end
36
50
  end
@@ -6,7 +6,7 @@ module Loader
6
6
  class StaticLoader < Loader
7
7
 
8
8
  BUILTIN_TYPE_NAMES = %w{
9
- Auegas
9
+ Augeas
10
10
  Component
11
11
  Computer
12
12
  Cron
@@ -113,7 +113,7 @@ class StaticLoader < Loader
113
113
  # These types are in all environments.
114
114
  #
115
115
  %w{
116
- Auegas
116
+ Augeas
117
117
  Component
118
118
  Computer
119
119
  Cron
@@ -566,8 +566,8 @@ class HieraConfigV5 < HieraConfig
566
566
  tf = Types::TypeFactory
567
567
  nes_t = Types::PStringType::NON_EMPTY
568
568
 
569
- # Need alias here to avoid ridiculously long regexp burp in case of validation errors.
570
- uri_t = Pcore::TYPE_URI_ALIAS
569
+ # Validated using Ruby URI implementation
570
+ uri_t = Types::PStringType::NON_EMPTY
571
571
 
572
572
  # The option name must start with a letter and end with a letter or digit. May contain underscore and dash.
573
573
  option_name_t = tf.pattern(/\A[A-Za-z](:?[0-9A-Za-z_-]*[0-9A-Za-z])?\z/)
@@ -120,7 +120,7 @@ module Puppet::Pops
120
120
  when 0
121
121
  throw :no_such_key
122
122
  when 1
123
- yield(lookup_variants[0])
123
+ merge_single(yield(lookup_variants[0]))
124
124
  else
125
125
  lookup_invocation.with(:merge, self) do
126
126
  result = lookup_variants.reduce(NOT_FOUND) do |memo, lookup_variant|
@@ -149,6 +149,13 @@ module Puppet::Pops
149
149
  value
150
150
  end
151
151
 
152
+ # Applies the merge strategy on a single element. Only applicable for `unique`
153
+ # @param value [Object] the value to merge with nothing
154
+ # @return [Object] the merged value
155
+ def merge_single(value)
156
+ value
157
+ end
158
+
152
159
  def options
153
160
  @options
154
161
  end
@@ -282,6 +289,14 @@ module Puppet::Pops
282
289
  e.is_a?(Array) ? e.flatten : [e]
283
290
  end
284
291
 
292
+ # If _value_ is an array, then return the result of calling `uniq` on that array. Otherwise,
293
+ # the argument is returned.
294
+ # @param value [Object] the value to merge with nothing
295
+ # @return [Object] the merged value
296
+ def merge_single(value)
297
+ value.is_a?(Array) ? value.uniq : value
298
+ end
299
+
285
300
  protected
286
301
 
287
302
  def value_t
@@ -79,6 +79,8 @@ module Puppet::Pops::Types
79
79
  o.finite_range? ? IntegerRangeIterator.new(o) : nil
80
80
  when PEnumType
81
81
  Iterator.new(o, o.values.each)
82
+ when PTypeAliasType
83
+ on(o.resolved_type)
82
84
  when Range
83
85
  min = o.min
84
86
  max = o.max
@@ -85,7 +85,7 @@ module TypeFactory
85
85
  size_type_or_value.nil? ? PStringType::DEFAULT : PStringType.new(size_type_or_value)
86
86
  else
87
87
  if Puppet[:strict] != :off
88
- Puppet.warn_once(:deprecatation, "TypeFactory#string_multi_args", "Passing more than one argument to TypeFactory#string is deprecated")
88
+ Puppet.warn_once(:deprecation, "TypeFactory#string_multi_args", "Passing more than one argument to TypeFactory#string is deprecated")
89
89
  end
90
90
  deprecated_second_argument.size == 1 ? PStringType.new(deprecated_second_argument[0]) : PEnumType.new(*deprecated_second_argument)
91
91
  end
@@ -343,8 +343,8 @@ module Types
343
343
  a = detailed_actual_to_s(e, a)
344
344
  e = e.map { |t| t.to_alias_expanded_s }
345
345
  else
346
- e = e.map { |t| t.simple_name }.uniq
347
- a = a.simple_name
346
+ e = e.map { |t| short_name(t) }.uniq
347
+ a = short_name(a)
348
348
  end
349
349
  case e.size
350
350
  when 1
@@ -361,8 +361,8 @@ module Types
361
361
  a = detailed_actual_to_s(e, a)
362
362
  e = e.to_alias_expanded_s
363
363
  else
364
- e = e.simple_name
365
- a = a.simple_name
364
+ e = short_name(e)
365
+ a = short_name(a)
366
366
  end
367
367
  end
368
368
  if multi
@@ -378,6 +378,16 @@ module Types
378
378
 
379
379
  private
380
380
 
381
+ def short_name(t)
382
+ # Ensure that Optional, NotUndef, Sensitive, and Type are reported with included
383
+ # type parameter.
384
+ if t.is_a?(PTypeWithContainedType) && !(t.type.nil? || t.type.class == PAnyType)
385
+ "#{t.name}[#{t.type.name}]"
386
+ else
387
+ t.name
388
+ end
389
+ end
390
+
381
391
  # Answers the question if `e` is a specialized type of `a`
382
392
  # @param e [PAnyType] the expected type
383
393
  # @param a [PAnyType] the actual type
@@ -477,7 +487,7 @@ module Types
477
487
 
478
488
  def actual_string
479
489
  a = actual
480
- a.is_a?(PStringType) && !a.value.nil? ? "'#{a.value}'" : a.simple_name
490
+ a.is_a?(PStringType) && !a.value.nil? ? "'#{a.value}'" : short_name(a)
481
491
  end
482
492
  end
483
493
 
@@ -1304,6 +1304,8 @@ class PIterableType < PTypeWithContainedType
1304
1304
  o >= 0
1305
1305
  when PIntegerType
1306
1306
  o.finite_range?
1307
+ when PTypeAliasType
1308
+ instance?(o.resolved_type, guard)
1307
1309
  else
1308
1310
  false
1309
1311
  end
@@ -1390,7 +1392,7 @@ class PStringType < PScalarType
1390
1392
  def initialize(size_type_or_value, deprecated_multi_args = EMPTY_ARRAY)
1391
1393
  unless deprecated_multi_args.empty?
1392
1394
  if Puppet[:strict] != :off
1393
- Puppet.warn_once(:deprecatation, "PStringType#initialize_multi_args", "Passing more than one argument to PStringType#initialize is deprecated")
1395
+ Puppet.warn_once(:deprecation, "PStringType#initialize_multi_args", "Passing more than one argument to PStringType#initialize is deprecated")
1394
1396
  end
1395
1397
  size_type_or_value = deprecated_multi_args[0]
1396
1398
  end
@@ -1443,7 +1445,7 @@ class PStringType < PScalarType
1443
1445
  # @api private
1444
1446
  def values
1445
1447
  if Puppet[:strict] != :off
1446
- Puppet.warn_once(:deprecatation, "PStringType#values", "Method PStringType#values is deprecated. Use #value instead")
1448
+ Puppet.warn_once(:deprecation, "PStringType#values", "Method PStringType#values is deprecated. Use #value instead")
1447
1449
  end
1448
1450
  @value.is_a?(String) ? [@value] : EMPTY_ARRAY
1449
1451
  end
@@ -135,8 +135,8 @@ Puppet::Type.type(:service).provide :smf, :parent => :base do
135
135
  states = service_states
136
136
  state = states[1] == "-" ? states[0] : states[1]
137
137
  rescue Puppet::ExecutionFailure
138
- debug "Could not get status on service #{self.name} #{$!}"
139
- return :absent
138
+ info "Could not get status on service #{self.name}"
139
+ return :stopped
140
140
  end
141
141
 
142
142
  case state
@@ -23,6 +23,7 @@ Puppet::Type.type(:service).provide :systemd, :parent => :base do
23
23
  defaultfor :osfamily => :redhat, :operatingsystem => :fedora
24
24
  defaultfor :osfamily => :suse
25
25
  defaultfor :osfamily => :coreos
26
+ defaultfor :operatingsystem => :amazon, :operatingsystemmajrelease => ["2"]
26
27
  defaultfor :operatingsystem => :debian, :operatingsystemmajrelease => ["8", "stretch/sid", "9", "buster/sid"]
27
28
  defaultfor :operatingsystem => :ubuntu, :operatingsystemmajrelease => ["15.04","15.10","16.04","16.10"]
28
29
  defaultfor :operatingsystem => :cumuluslinux, :operatingsystemmajrelease => ["3"]
@@ -14,7 +14,7 @@ Puppet::Type.type(:service).provide :upstart, :parent => :debian do
14
14
  confine :any => [
15
15
  Facter.value(:operatingsystem) == 'Ubuntu',
16
16
  (Facter.value(:osfamily) == 'RedHat' and Facter.value(:operatingsystemrelease) =~ /^6\./),
17
- Facter.value(:operatingsystem) == 'Amazon',
17
+ (Facter.value(:operatingsystem) == 'Amazon' and Facter.value(:operatingsystemmajrelease) =~ /\d{4}/),
18
18
  Facter.value(:operatingsystem) == 'LinuxMint',
19
19
  ]
20
20
 
@@ -138,13 +138,21 @@ class Puppet::Settings::EnvironmentConf
138
138
  section_keys = config.sections.keys
139
139
  main = config.sections[:main]
140
140
  if section_keys.size > 1
141
- Puppet.warning("Invalid sections in environment.conf at '#{path_to_conf_file}'. Environment conf may not have sections. The following sections are being ignored: '#{(section_keys - [:main]).join(',')}'")
141
+ # warn once per config file path
142
+ Puppet.warn_once(
143
+ :invalid_settings_section, "EnvironmentConf-section:#{path_to_conf_file}",
144
+ "Invalid sections in environment.conf at '#{path_to_conf_file}'. Environment conf may not have sections. The following sections are being ignored: '#{(section_keys - [:main]).join(',')}'"
145
+ )
142
146
  valid = false
143
147
  end
144
148
 
145
149
  extraneous_settings = main.settings.map(&:name) - VALID_SETTINGS
146
150
  if !extraneous_settings.empty?
147
- Puppet.warning("Invalid settings in environment.conf at '#{path_to_conf_file}'. The following unknown setting(s) are being ignored: #{extraneous_settings.join(', ')}")
151
+ # warn once per config file path
152
+ Puppet.warn_once(
153
+ :invalid_settings, "EnvironmentConf-settings:#{path_to_conf_file}",
154
+ "Invalid settings in environment.conf at '#{path_to_conf_file}'. The following unknown setting(s) are being ignored: #{extraneous_settings.join(', ')}"
155
+ )
148
156
  valid = false
149
157
  end
150
158
 
@@ -171,6 +171,9 @@ class Puppet::Transaction
171
171
  report.resources_failed_to_generate = true
172
172
  end
173
173
 
174
+ # mark the end of transaction evaluate.
175
+ report.transaction_completed = true
176
+
174
177
  Puppet.debug "Finishing transaction #{object_id}"
175
178
  end
176
179
 
@@ -132,6 +132,10 @@ class Puppet::Transaction::Report
132
132
  #
133
133
  attr_accessor :resources_failed_to_generate
134
134
 
135
+ # @return [Boolean] true if the transaction completed it's evaluate
136
+ #
137
+ attr_accessor :transaction_completed
138
+
135
139
  def self.from_data_hash(data)
136
140
  obj = self.allocate
137
141
  obj.initialize_from_hash(data)
@@ -172,7 +176,9 @@ class Puppet::Transaction::Report
172
176
 
173
177
  # @api private
174
178
  def compute_status(resource_metrics, change_metric)
175
- if resources_failed_to_generate || (resource_metrics["failed"] || 0) > 0
179
+ if resources_failed_to_generate ||
180
+ !transaction_completed ||
181
+ (resource_metrics["failed"] || 0) > 0
176
182
  'failed'
177
183
  elsif change_metric > 0
178
184
  'changed'
@@ -227,6 +233,7 @@ class Puppet::Transaction::Report
227
233
  @noop = Puppet[:noop]
228
234
  @noop_pending = false
229
235
  @corrective_change = false
236
+ @transaction_completed = false
230
237
  end
231
238
 
232
239
  # @api private
@@ -1295,9 +1295,7 @@ class Type
1295
1295
  end
1296
1296
 
1297
1297
  newmetaparam(:audit) do
1298
- desc "(This metaparameter is deprecated and will be ignored in a future release.)
1299
-
1300
- Marks a subset of this resource's unmanaged attributes for auditing. Accepts an
1298
+ desc "Marks a subset of this resource's unmanaged attributes for auditing. Accepts an
1301
1299
  attribute name, an array of attribute names, or `all`.
1302
1300
 
1303
1301
  Auditing a resource attribute has two effects: First, whenever a catalog
@@ -1318,12 +1316,6 @@ class Type
1318
1316
  and the second run will log the edit made by Puppet.)"
1319
1317
 
1320
1318
  validate do |list|
1321
- if Puppet.settings[:strict] != :off
1322
- # Only warn if `audit` metaparam came from a manifest
1323
- if file && line
1324
- puppet_deprecation_warning(_("The `audit` metaparameter is deprecated and will be ignored in a future release."), { :line => line, :file => file })
1325
- end
1326
- end
1327
1319
  list = Array(list).collect {|p| p.to_sym}
1328
1320
  unless list == [:all]
1329
1321
  list.each do |param|