puppet 7.10.0-universal-darwin → 7.13.1-universal-darwin

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -3
  3. data/Gemfile.lock +20 -15
  4. data/ext/project_data.yaml +1 -1
  5. data/lib/puppet/application/agent.rb +4 -0
  6. data/lib/puppet/application/apply.rb +20 -2
  7. data/lib/puppet/application/lookup.rb +72 -24
  8. data/lib/puppet/application/resource.rb +15 -13
  9. data/lib/puppet/concurrent/thread_local_singleton.rb +6 -3
  10. data/lib/puppet/configurer.rb +98 -29
  11. data/lib/puppet/confine/variable.rb +1 -1
  12. data/lib/puppet/defaults.rb +17 -3
  13. data/lib/puppet/facter_impl.rb +96 -0
  14. data/lib/puppet/file_serving/metadata.rb +3 -0
  15. data/lib/puppet/file_serving/mount/file.rb +4 -4
  16. data/lib/puppet/file_system/file_impl.rb +10 -8
  17. data/lib/puppet/file_system/jruby.rb +1 -1
  18. data/lib/puppet/file_system/path_pattern.rb +10 -15
  19. data/lib/puppet/file_system/uniquefile.rb +1 -1
  20. data/lib/puppet/file_system/windows.rb +4 -4
  21. data/lib/puppet/file_system.rb +3 -2
  22. data/lib/puppet/forge.rb +1 -1
  23. data/lib/puppet/functions/versioncmp.rb +6 -2
  24. data/lib/puppet/graph/simple_graph.rb +2 -1
  25. data/lib/puppet/http/client.rb +1 -1
  26. data/lib/puppet/http/redirector.rb +5 -0
  27. data/lib/puppet/indirector/catalog/compiler.rb +3 -3
  28. data/lib/puppet/indirector/facts/facter.rb +6 -6
  29. data/lib/puppet/indirector/indirection.rb +1 -1
  30. data/lib/puppet/module_tool/applications/uninstaller.rb +1 -1
  31. data/lib/puppet/module_tool/applications/upgrader.rb +1 -1
  32. data/lib/puppet/pal/pal_impl.rb +1 -1
  33. data/lib/puppet/parser/resource.rb +1 -1
  34. data/lib/puppet/parser/scope.rb +8 -7
  35. data/lib/puppet/parser/templatewrapper.rb +1 -0
  36. data/lib/puppet/pops/evaluator/closure.rb +7 -5
  37. data/lib/puppet/pops/evaluator/runtime3_resource_support.rb +1 -0
  38. data/lib/puppet/pops/lookup/lookup_adapter.rb +3 -2
  39. data/lib/puppet/pops/model/ast.rb +1 -0
  40. data/lib/puppet/pops/model/factory.rb +14 -13
  41. data/lib/puppet/pops/parser/code_merger.rb +4 -4
  42. data/lib/puppet/pops/parser/egrammar.ra +4 -2
  43. data/lib/puppet/pops/parser/eparser.rb +909 -894
  44. data/lib/puppet/pops/parser/lexer2.rb +69 -68
  45. data/lib/puppet/pops/parser/slurp_support.rb +1 -0
  46. data/lib/puppet/pops/serialization/to_data_converter.rb +6 -18
  47. data/lib/puppet/pops/serialization/to_stringified_converter.rb +1 -1
  48. data/lib/puppet/pops/types/type_formatter.rb +7 -6
  49. data/lib/puppet/pops/types/types.rb +1 -1
  50. data/lib/puppet/pops/validation/checker4_0.rb +7 -2
  51. data/lib/puppet/provider/aix_object.rb +1 -1
  52. data/lib/puppet/provider/group/groupadd.rb +5 -2
  53. data/lib/puppet/provider/package/pkg.rb +11 -1
  54. data/lib/puppet/provider/package/puppet_gem.rb +1 -1
  55. data/lib/puppet/provider/package/puppetserver_gem.rb +1 -1
  56. data/lib/puppet/provider/package/yum.rb +1 -1
  57. data/lib/puppet/provider/service/base.rb +1 -1
  58. data/lib/puppet/provider/service/init.rb +10 -9
  59. data/lib/puppet/provider/service/launchd.rb +1 -1
  60. data/lib/puppet/provider/service/redhat.rb +1 -1
  61. data/lib/puppet/provider/service/smf.rb +3 -3
  62. data/lib/puppet/provider/service/systemd.rb +1 -1
  63. data/lib/puppet/provider/service/upstart.rb +5 -5
  64. data/lib/puppet/provider/user/aix.rb +44 -1
  65. data/lib/puppet/provider/user/directoryservice.rb +1 -1
  66. data/lib/puppet/provider/user/useradd.rb +30 -7
  67. data/lib/puppet/provider.rb +1 -1
  68. data/lib/puppet/reference/providers.rb +2 -2
  69. data/lib/puppet/resource/catalog.rb +1 -1
  70. data/lib/puppet/resource/type_collection.rb +2 -1
  71. data/lib/puppet/resource.rb +38 -5
  72. data/lib/puppet/runtime.rb +11 -1
  73. data/lib/puppet/settings/file_setting.rb +3 -8
  74. data/lib/puppet/settings.rb +2 -2
  75. data/lib/puppet/ssl/verifier.rb +3 -1
  76. data/lib/puppet/test/test_helper.rb +4 -1
  77. data/lib/puppet/transaction/persistence.rb +22 -12
  78. data/lib/puppet/type/exec.rb +9 -1
  79. data/lib/puppet/type/file/data_sync.rb +1 -1
  80. data/lib/puppet/type/file/group.rb +8 -1
  81. data/lib/puppet/type/file/owner.rb +8 -1
  82. data/lib/puppet/type/group.rb +0 -1
  83. data/lib/puppet/type/resources.rb +1 -1
  84. data/lib/puppet/type/service.rb +8 -3
  85. data/lib/puppet/type/user.rb +40 -39
  86. data/lib/puppet/util/autoload.rb +1 -1
  87. data/lib/puppet/util/command_line.rb +1 -1
  88. data/lib/puppet/util/filetype.rb +2 -2
  89. data/lib/puppet/util/json.rb +20 -0
  90. data/lib/puppet/util/log.rb +8 -4
  91. data/lib/puppet/util/logging.rb +1 -25
  92. data/lib/puppet/util/monkey_patches.rb +26 -2
  93. data/lib/puppet/util/package.rb +25 -16
  94. data/lib/puppet/util/pidlock.rb +1 -1
  95. data/lib/puppet/util/rdoc/parser/puppet_parser_core.rb +1 -1
  96. data/lib/puppet/util/suidmanager.rb +1 -2
  97. data/lib/puppet/util/tagging.rb +1 -0
  98. data/lib/puppet/util/windows/service.rb +0 -5
  99. data/lib/puppet/util/windows/user.rb +0 -1
  100. data/lib/puppet/util/windows.rb +3 -0
  101. data/lib/puppet/util/yaml.rb +11 -0
  102. data/lib/puppet/util.rb +4 -3
  103. data/lib/puppet/version.rb +1 -1
  104. data/lib/puppet.rb +3 -6
  105. data/locales/puppet.pot +265 -239
  106. data/man/man5/puppet.conf.5 +18 -2
  107. data/man/man8/puppet-agent.8 +4 -1
  108. data/man/man8/puppet-apply.8 +1 -1
  109. data/man/man8/puppet-catalog.8 +1 -1
  110. data/man/man8/puppet-config.8 +1 -1
  111. data/man/man8/puppet-describe.8 +1 -1
  112. data/man/man8/puppet-device.8 +1 -1
  113. data/man/man8/puppet-doc.8 +1 -1
  114. data/man/man8/puppet-epp.8 +1 -1
  115. data/man/man8/puppet-facts.8 +1 -1
  116. data/man/man8/puppet-filebucket.8 +1 -1
  117. data/man/man8/puppet-generate.8 +1 -1
  118. data/man/man8/puppet-help.8 +1 -1
  119. data/man/man8/puppet-lookup.8 +9 -6
  120. data/man/man8/puppet-module.8 +1 -1
  121. data/man/man8/puppet-node.8 +1 -1
  122. data/man/man8/puppet-parser.8 +1 -1
  123. data/man/man8/puppet-plugin.8 +1 -1
  124. data/man/man8/puppet-report.8 +1 -1
  125. data/man/man8/puppet-resource.8 +1 -1
  126. data/man/man8/puppet-script.8 +1 -1
  127. data/man/man8/puppet-ssl.8 +1 -1
  128. data/man/man8/puppet.8 +2 -2
  129. data/spec/fixtures/integration/application/agent/cached_deferred_catalog.json +2 -1
  130. data/spec/fixtures/unit/forge/bacula.json +1 -1
  131. data/spec/integration/application/agent_spec.rb +44 -0
  132. data/spec/integration/application/lookup_spec.rb +29 -6
  133. data/spec/integration/configurer_spec.rb +1 -1
  134. data/spec/integration/indirector/facts/facter_spec.rb +3 -3
  135. data/spec/integration/parser/pcore_resource_spec.rb +20 -0
  136. data/spec/integration/transaction/report_spec.rb +1 -1
  137. data/spec/integration/type/file_spec.rb +2 -2
  138. data/spec/integration/type/package_spec.rb +6 -6
  139. data/spec/integration/util/rdoc/parser_spec.rb +1 -1
  140. data/spec/integration/util/windows/process_spec.rb +1 -9
  141. data/spec/shared_contexts/l10n.rb +5 -0
  142. data/spec/unit/application/apply_spec.rb +76 -56
  143. data/spec/unit/application/lookup_spec.rb +131 -10
  144. data/spec/unit/application/resource_spec.rb +29 -0
  145. data/spec/unit/concurrent/thread_local_singleton_spec.rb +39 -0
  146. data/spec/unit/configurer_spec.rb +113 -28
  147. data/spec/unit/facter_impl_spec.rb +31 -0
  148. data/spec/unit/file_bucket/dipper_spec.rb +2 -2
  149. data/spec/unit/file_system/uniquefile_spec.rb +7 -1
  150. data/spec/unit/file_system_spec.rb +41 -4
  151. data/spec/unit/forge/module_release_spec.rb +3 -3
  152. data/spec/unit/functions/lookup_spec.rb +64 -0
  153. data/spec/unit/functions/versioncmp_spec.rb +40 -4
  154. data/spec/unit/http/client_spec.rb +58 -1
  155. data/spec/unit/indirector/indirection_spec.rb +10 -3
  156. data/spec/unit/network/formats_spec.rb +6 -0
  157. data/spec/unit/pops/parser/parse_containers_spec.rb +2 -2
  158. data/spec/unit/pops/serialization/to_from_hr_spec.rb +0 -58
  159. data/spec/unit/pops/serialization/to_stringified_spec.rb +5 -0
  160. data/spec/unit/pops/types/type_calculator_spec.rb +6 -0
  161. data/spec/unit/pops/validator/validator_spec.rb +5 -0
  162. data/spec/unit/provider/package/gem_spec.rb +1 -1
  163. data/spec/unit/provider/package/pip2_spec.rb +1 -1
  164. data/spec/unit/provider/package/pip3_spec.rb +1 -1
  165. data/spec/unit/provider/package/pip_spec.rb +1 -1
  166. data/spec/unit/provider/package/pkg_spec.rb +15 -0
  167. data/spec/unit/provider/package/puppet_gem_spec.rb +1 -1
  168. data/spec/unit/provider/package/puppetserver_gem_spec.rb +1 -1
  169. data/spec/unit/provider/service/gentoo_spec.rb +6 -5
  170. data/spec/unit/provider/service/init_spec.rb +15 -9
  171. data/spec/unit/provider/service/openwrt_spec.rb +21 -29
  172. data/spec/unit/provider/service/redhat_spec.rb +3 -2
  173. data/spec/unit/provider/user/aix_spec.rb +100 -0
  174. data/spec/unit/provider/user/directoryservice_spec.rb +1 -1
  175. data/spec/unit/provider/user/useradd_spec.rb +40 -0
  176. data/spec/unit/provider_spec.rb +4 -4
  177. data/spec/unit/puppet_spec.rb +12 -4
  178. data/spec/unit/resource/catalog_spec.rb +14 -1
  179. data/spec/unit/resource_spec.rb +58 -2
  180. data/spec/unit/settings/file_setting_spec.rb +10 -7
  181. data/spec/unit/transaction/persistence_spec.rb +51 -0
  182. data/spec/unit/type/file/group_spec.rb +7 -0
  183. data/spec/unit/type/file/owner_spec.rb +7 -0
  184. data/spec/unit/type/service_spec.rb +27 -0
  185. data/spec/unit/type/user_spec.rb +0 -45
  186. data/spec/unit/type_spec.rb +2 -2
  187. data/spec/unit/util/autoload_spec.rb +25 -8
  188. data/spec/unit/util/json_spec.rb +126 -0
  189. data/spec/unit/util/logging_spec.rb +2 -0
  190. data/spec/unit/util/yaml_spec.rb +37 -13
  191. data/tasks/parallel.rake +3 -3
  192. metadata +17 -4
@@ -40,6 +40,7 @@ module Runtime3ResourceSupport
40
40
  :parameters => evaluated_parameters,
41
41
  :file => file,
42
42
  :line => line,
43
+ :kind => Puppet::Resource.to_kind(resolved_type),
43
44
  :exported => exported,
44
45
  :virtual => virtual,
45
46
  # WTF is this? Which source is this? The file? The name of the context ?
@@ -292,7 +292,8 @@ class LookupAdapter < DataAdapter
292
292
  PROVIDER_STACK = [:lookup_global, :lookup_in_environment, :lookup_in_module].freeze
293
293
 
294
294
  def validate_lookup_options(options, module_name)
295
- raise Puppet::DataBinding::LookupError.new(_("value of %{opts} must be a hash") % { opts: LOOKUP_OPTIONS }) unless options.is_a?(Hash) unless options.nil?
295
+ return nil if options.nil?
296
+ raise Puppet::DataBinding::LookupError.new(_("value of %{opts} must be a hash") % { opts: LOOKUP_OPTIONS }) unless options.is_a?(Hash)
296
297
  return options if module_name.nil?
297
298
 
298
299
  pfx = "#{module_name}::"
@@ -352,7 +353,7 @@ class LookupAdapter < DataAdapter
352
353
  module_opts = validate_lookup_options(lookup_in_module(LookupKey::LOOKUP_OPTIONS, meta_invocation, merge_strategy), module_name)
353
354
  opts = if opts.nil?
354
355
  module_opts
355
- else
356
+ elsif module_opts
356
357
  merge_strategy.lookup([GLOBAL_ENV_MERGE, "Module #{lookup_invocation.module_name}"], meta_invocation) do |n|
357
358
  meta_invocation.with(:scope, n) { meta_invocation.report_found(LOOKUP_OPTIONS, n == GLOBAL_ENV_MERGE ? opts : module_opts) }
358
359
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # # Generated by Puppet::Pops::Types::RubyGenerator from TypeSet Puppet::AST on -4712-01-01
2
3
 
3
4
  module Puppet
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Factory is a helper class that makes construction of a Pops Model
2
3
  # much more convenient. It can be viewed as a small internal DSL for model
3
4
  # constructions.
@@ -11,19 +12,19 @@ module Model
11
12
  class Factory
12
13
  # Shared build_visitor, since there are many instances of Factory being used
13
14
 
14
- KEY_LENGTH = 'length'.freeze
15
- KEY_OFFSET = 'offset'.freeze
16
- KEY_LOCATOR = 'locator'.freeze
17
- KEY_OPERATOR = 'operator'.freeze
15
+ KEY_LENGTH = 'length'
16
+ KEY_OFFSET = 'offset'
17
+ KEY_LOCATOR = 'locator'
18
+ KEY_OPERATOR = 'operator'
18
19
 
19
- KEY_VALUE = 'value'.freeze
20
- KEY_KEYS = 'keys'.freeze
21
- KEY_NAME = 'name'.freeze
22
- KEY_BODY = 'body'.freeze
23
- KEY_EXPR = 'expr'.freeze
24
- KEY_LEFT_EXPR = 'left_expr'.freeze
25
- KEY_RIGHT_EXPR = 'right_expr'.freeze
26
- KEY_PARAMETERS = 'parameters'.freeze
20
+ KEY_VALUE = 'value'
21
+ KEY_KEYS = 'keys'
22
+ KEY_NAME = 'name'
23
+ KEY_BODY = 'body'
24
+ KEY_EXPR = 'expr'
25
+ KEY_LEFT_EXPR = 'left_expr'
26
+ KEY_RIGHT_EXPR = 'right_expr'
27
+ KEY_PARAMETERS = 'parameters'
27
28
 
28
29
  BUILD_VISITOR = Visitor.new(self, 'build')
29
30
  INFER_VISITOR = Visitor.new(self, 'infer')
@@ -1111,7 +1112,7 @@ class Factory
1111
1112
  end
1112
1113
 
1113
1114
  def self.concat(*args)
1114
- result = ''
1115
+ result = ''.dup
1115
1116
  args.each do |e|
1116
1117
  if e.instance_of?(Factory) && e.model_class <= LiteralString
1117
1118
  result << e[KEY_VALUE]
@@ -11,17 +11,17 @@ class Puppet::Pops::Parser::CodeMerger
11
11
  # PUP-5299, some sites have thousands of entries, and run out of stack when evaluating - the logic
12
12
  # below maps the logic as flatly as possible.
13
13
  #
14
- children = parse_results.select {|x| !x.nil? && x.code}.reduce([]) do |memo, parsed_class|
14
+ children = parse_results.select {|x| !x.nil? && x.code}.flat_map do |parsed_class|
15
15
  case parsed_class.code
16
16
  when Puppet::Parser::AST::BlockExpression
17
17
  # the BlockExpression wraps a single 4x instruction that is most likely wrapped in a Factory
18
- memo + parsed_class.code.children.map {|c| c.is_a?(Puppet::Pops::Model::Factory) ? c.model : c }
18
+ parsed_class.code.children.map {|c| c.is_a?(Puppet::Pops::Model::Factory) ? c.model : c }
19
19
  when Puppet::Pops::Model::Factory
20
20
  # If it is a 4x instruction wrapped in a Factory
21
- memo + parsed_class.code.model
21
+ parsed_class.code.model
22
22
  else
23
23
  # It is the instruction directly
24
- memo << parsed_class.code
24
+ parsed_class.code
25
25
  end
26
26
  end
27
27
  Puppet::Parser::AST::BlockExpression.new(:children => children)
@@ -863,6 +863,8 @@ keyword
863
863
  | ATTR
864
864
  | FUNCTION
865
865
  | PRIVATE
866
+ | PLAN
867
+ | APPLY
866
868
 
867
869
  nil
868
870
  : { result = nil}
@@ -870,8 +872,8 @@ nil
870
872
  end
871
873
 
872
874
  ---- header ----
873
- require 'puppet'
874
- require 'puppet/pops'
875
+ require_relative '../../../puppet'
876
+ require_relative '../../../puppet/pops'
875
877
 
876
878
  module Puppet
877
879
  class ParseError < Puppet::Error; end