bolt 0.20.3 → 0.20.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bolt might be problematic. Click here for more details.

Files changed (256) hide show
  1. checksums.yaml +4 -4
  2. data/bolt-modules/boltlib/lib/puppet/functions/run_task.rb +3 -3
  3. data/bolt-modules/boltlib/lib/puppet/functions/set_feature.rb +33 -0
  4. data/lib/bolt/inventory.rb +19 -1
  5. data/lib/bolt/target.rb +15 -0
  6. data/lib/bolt/transport/local.rb +6 -1
  7. data/lib/bolt/transport/orch.rb +2 -0
  8. data/lib/bolt/transport/ssh.rb +7 -2
  9. data/lib/bolt/transport/winrm.rb +6 -1
  10. data/lib/bolt/version.rb +1 -1
  11. data/modules/facts/plans/retrieve.pp +2 -26
  12. data/modules/facts/tasks/init.json +9 -0
  13. data/vendored/puppet/lib/hiera/puppet_function.rb +1 -1
  14. data/vendored/puppet/lib/hiera/scope.rb +24 -2
  15. data/vendored/puppet/lib/puppet.rb +4 -13
  16. data/vendored/puppet/lib/puppet/application.rb +2 -2
  17. data/vendored/puppet/lib/puppet/application/agent.rb +1 -1
  18. data/vendored/puppet/lib/puppet/application/apply.rb +1 -1
  19. data/vendored/puppet/lib/puppet/application/cert.rb +1 -1
  20. data/vendored/puppet/lib/puppet/application/device.rb +8 -8
  21. data/vendored/puppet/lib/puppet/application/face_base.rb +1 -1
  22. data/vendored/puppet/lib/puppet/application/lookup.rb +2 -2
  23. data/vendored/puppet/lib/puppet/application/resource.rb +2 -2
  24. data/vendored/puppet/lib/puppet/application/script.rb +1 -1
  25. data/vendored/puppet/lib/puppet/configurer.rb +47 -24
  26. data/vendored/puppet/lib/puppet/confine.rb +4 -1
  27. data/vendored/puppet/lib/puppet/context.rb +1 -1
  28. data/vendored/puppet/lib/puppet/defaults.rb +32 -44
  29. data/vendored/puppet/lib/puppet/error.rb +14 -7
  30. data/vendored/puppet/lib/puppet/external/dot.rb +23 -17
  31. data/vendored/puppet/lib/puppet/face/config.rb +58 -3
  32. data/vendored/puppet/lib/puppet/face/epp.rb +1 -1
  33. data/vendored/puppet/lib/puppet/face/module/build.rb +3 -3
  34. data/vendored/puppet/lib/puppet/face/module/install.rb +0 -4
  35. data/vendored/puppet/lib/puppet/face/module/list.rb +0 -5
  36. data/vendored/puppet/lib/puppet/face/module/search.rb +1 -1
  37. data/vendored/puppet/lib/puppet/face/module/uninstall.rb +0 -4
  38. data/vendored/puppet/lib/puppet/face/module/upgrade.rb +0 -4
  39. data/vendored/puppet/lib/puppet/face/status.rb +2 -2
  40. data/vendored/puppet/lib/puppet/file_serving/base.rb +5 -5
  41. data/vendored/puppet/lib/puppet/file_serving/metadata.rb +2 -1
  42. data/vendored/puppet/lib/puppet/forge.rb +7 -8
  43. data/vendored/puppet/lib/puppet/forge/errors.rb +3 -3
  44. data/vendored/puppet/lib/puppet/functions/abs.rb +61 -0
  45. data/vendored/puppet/lib/puppet/functions/all.rb +2 -2
  46. data/vendored/puppet/lib/puppet/functions/any.rb +2 -2
  47. data/vendored/puppet/lib/puppet/functions/assert_type.rb +3 -3
  48. data/vendored/puppet/lib/puppet/functions/break.rb +3 -7
  49. data/vendored/puppet/lib/puppet/functions/camelcase.rb +62 -0
  50. data/vendored/puppet/lib/puppet/functions/capitalize.rb +61 -0
  51. data/vendored/puppet/lib/puppet/functions/ceiling.rb +37 -0
  52. data/vendored/puppet/lib/puppet/functions/chomp.rb +57 -0
  53. data/vendored/puppet/lib/puppet/functions/chop.rb +67 -0
  54. data/vendored/puppet/lib/puppet/functions/compare.rb +125 -0
  55. data/vendored/puppet/lib/puppet/functions/convert_to.rb +3 -2
  56. data/vendored/puppet/lib/puppet/functions/dig.rb +21 -1
  57. data/vendored/puppet/lib/puppet/functions/downcase.rb +89 -0
  58. data/vendored/puppet/lib/puppet/functions/each.rb +2 -2
  59. data/vendored/puppet/lib/puppet/functions/empty.rb +1 -3
  60. data/vendored/puppet/lib/puppet/functions/eyaml_lookup_key.rb +4 -2
  61. data/vendored/puppet/lib/puppet/functions/filter.rb +2 -2
  62. data/vendored/puppet/lib/puppet/functions/floor.rb +37 -0
  63. data/vendored/puppet/lib/puppet/functions/get.rb +150 -0
  64. data/vendored/puppet/lib/puppet/functions/getvar.rb +87 -0
  65. data/vendored/puppet/lib/puppet/functions/hiera.rb +5 -5
  66. data/vendored/puppet/lib/puppet/functions/hiera_array.rb +5 -5
  67. data/vendored/puppet/lib/puppet/functions/hiera_hash.rb +6 -6
  68. data/vendored/puppet/lib/puppet/functions/hiera_include.rb +7 -7
  69. data/vendored/puppet/lib/puppet/functions/hocon_data.rb +1 -1
  70. data/vendored/puppet/lib/puppet/functions/json_data.rb +3 -3
  71. data/vendored/puppet/lib/puppet/functions/lest.rb +1 -1
  72. data/vendored/puppet/lib/puppet/functions/lookup.rb +3 -2
  73. data/vendored/puppet/lib/puppet/functions/lstrip.rb +58 -0
  74. data/vendored/puppet/lib/puppet/functions/map.rb +1 -1
  75. data/vendored/puppet/lib/puppet/functions/match.rb +11 -0
  76. data/vendored/puppet/lib/puppet/functions/max.rb +183 -0
  77. data/vendored/puppet/lib/puppet/functions/min.rb +182 -0
  78. data/vendored/puppet/lib/puppet/functions/next.rb +1 -8
  79. data/vendored/puppet/lib/puppet/functions/reduce.rb +1 -1
  80. data/vendored/puppet/lib/puppet/functions/return.rb +1 -8
  81. data/vendored/puppet/lib/puppet/functions/reverse_each.rb +1 -1
  82. data/vendored/puppet/lib/puppet/functions/round.rb +24 -0
  83. data/vendored/puppet/lib/puppet/functions/rstrip.rb +58 -0
  84. data/vendored/puppet/lib/puppet/functions/size.rb +15 -0
  85. data/vendored/puppet/lib/puppet/functions/sort.rb +74 -0
  86. data/vendored/puppet/lib/puppet/functions/step.rb +1 -1
  87. data/vendored/puppet/lib/puppet/functions/strftime.rb +1 -7
  88. data/vendored/puppet/lib/puppet/functions/strip.rb +58 -0
  89. data/vendored/puppet/lib/puppet/functions/then.rb +1 -1
  90. data/vendored/puppet/lib/puppet/functions/tree_each.rb +7 -7
  91. data/vendored/puppet/lib/puppet/functions/upcase.rb +89 -0
  92. data/vendored/puppet/lib/puppet/functions/with.rb +4 -4
  93. data/vendored/puppet/lib/puppet/functions/yaml_data.rb +4 -2
  94. data/vendored/puppet/lib/puppet/graph/simple_graph.rb +9 -5
  95. data/vendored/puppet/lib/puppet/indirector/certificate_revocation_list/rest.rb +0 -11
  96. data/vendored/puppet/lib/puppet/indirector/indirection.rb +8 -12
  97. data/vendored/puppet/lib/puppet/indirector/node/exec.rb +1 -1
  98. data/vendored/puppet/lib/puppet/indirector/node/ldap.rb +1 -1
  99. data/vendored/puppet/lib/puppet/indirector/request.rb +11 -11
  100. data/vendored/puppet/lib/puppet/indirector/rest.rb +11 -11
  101. data/vendored/puppet/lib/puppet/interface/action.rb +2 -5
  102. data/vendored/puppet/lib/puppet/metatype/manager.rb +0 -2
  103. data/vendored/puppet/lib/puppet/module.rb +7 -33
  104. data/vendored/puppet/lib/puppet/module/task.rb +0 -1
  105. data/vendored/puppet/lib/puppet/module_tool.rb +2 -5
  106. data/vendored/puppet/lib/puppet/module_tool/applications/application.rb +5 -5
  107. data/vendored/puppet/lib/puppet/module_tool/applications/builder.rb +2 -2
  108. data/vendored/puppet/lib/puppet/module_tool/applications/checksummer.rb +3 -3
  109. data/vendored/puppet/lib/puppet/module_tool/applications/installer.rb +6 -7
  110. data/vendored/puppet/lib/puppet/module_tool/applications/uninstaller.rb +1 -2
  111. data/vendored/puppet/lib/puppet/module_tool/applications/unpacker.rb +2 -2
  112. data/vendored/puppet/lib/puppet/module_tool/applications/upgrader.rb +5 -6
  113. data/vendored/puppet/lib/puppet/module_tool/dependency.rb +1 -1
  114. data/vendored/puppet/lib/puppet/module_tool/installed_modules.rb +2 -2
  115. data/vendored/puppet/lib/puppet/module_tool/local_tarball.rb +3 -3
  116. data/vendored/puppet/lib/puppet/module_tool/metadata.rb +3 -4
  117. data/vendored/puppet/lib/puppet/module_tool/shared_behaviors.rb +2 -2
  118. data/vendored/puppet/lib/puppet/network/authconfig.rb +0 -13
  119. data/vendored/puppet/lib/puppet/network/format_support.rb +1 -1
  120. data/vendored/puppet/lib/puppet/network/formats.rb +5 -7
  121. data/vendored/puppet/lib/puppet/network/http.rb +0 -2
  122. data/vendored/puppet/lib/puppet/network/http/api.rb +1 -10
  123. data/vendored/puppet/lib/puppet/network/http/api/master/v3/environment.rb +2 -2
  124. data/vendored/puppet/lib/puppet/network/http/api/master/v3/environments.rb +2 -2
  125. data/vendored/puppet/lib/puppet/network/http/compression.rb +1 -1
  126. data/vendored/puppet/lib/puppet/network/http/connection.rb +11 -3
  127. data/vendored/puppet/lib/puppet/network/http/error.rb +3 -3
  128. data/vendored/puppet/lib/puppet/network/http/factory.rb +3 -0
  129. data/vendored/puppet/lib/puppet/network/http/handler.rb +59 -27
  130. data/vendored/puppet/lib/puppet/network/resolver.rb +140 -67
  131. data/vendored/puppet/lib/puppet/node/environment.rb +2 -19
  132. data/vendored/puppet/lib/puppet/parameter.rb +12 -7
  133. data/vendored/puppet/lib/puppet/parser/ast.rb +4 -8
  134. data/vendored/puppet/lib/puppet/parser/ast/branch.rb +3 -3
  135. data/vendored/puppet/lib/puppet/parser/ast/leaf.rb +5 -0
  136. data/vendored/puppet/lib/puppet/parser/ast/pops_bridge.rb +18 -0
  137. data/vendored/puppet/lib/puppet/parser/compiler.rb +3 -4
  138. data/vendored/puppet/lib/puppet/parser/compiler/catalog_validator/relationship_validator.rb +9 -2
  139. data/vendored/puppet/lib/puppet/parser/functions.rb +1 -1
  140. data/vendored/puppet/lib/puppet/parser/functions/assert_type.rb +3 -3
  141. data/vendored/puppet/lib/puppet/parser/functions/create_resources.rb +1 -7
  142. data/vendored/puppet/lib/puppet/parser/functions/each.rb +2 -2
  143. data/vendored/puppet/lib/puppet/parser/functions/filter.rb +1 -1
  144. data/vendored/puppet/lib/puppet/parser/functions/hiera.rb +4 -4
  145. data/vendored/puppet/lib/puppet/parser/functions/hiera_array.rb +5 -5
  146. data/vendored/puppet/lib/puppet/parser/functions/hiera_hash.rb +6 -6
  147. data/vendored/puppet/lib/puppet/parser/functions/hiera_include.rb +10 -11
  148. data/vendored/puppet/lib/puppet/parser/functions/inline_template.rb +1 -1
  149. data/vendored/puppet/lib/puppet/parser/functions/lest.rb +1 -1
  150. data/vendored/puppet/lib/puppet/parser/functions/lookup.rb +1 -1
  151. data/vendored/puppet/lib/puppet/parser/functions/map.rb +1 -1
  152. data/vendored/puppet/lib/puppet/parser/functions/reduce.rb +1 -1
  153. data/vendored/puppet/lib/puppet/parser/functions/return.rb +22 -1
  154. data/vendored/puppet/lib/puppet/parser/functions/reverse_each.rb +1 -1
  155. data/vendored/puppet/lib/puppet/parser/functions/step.rb +1 -1
  156. data/vendored/puppet/lib/puppet/parser/functions/then.rb +1 -1
  157. data/vendored/puppet/lib/puppet/parser/functions/with.rb +4 -4
  158. data/vendored/puppet/lib/puppet/parser/resource.rb +0 -1
  159. data/vendored/puppet/lib/puppet/parser/resource/param.rb +12 -5
  160. data/vendored/puppet/lib/puppet/parser/scope.rb +5 -7
  161. data/vendored/puppet/lib/puppet/pops/evaluator/compare_operator.rb +3 -1
  162. data/vendored/puppet/lib/puppet/pops/evaluator/runtime3_support.rb +2 -7
  163. data/vendored/puppet/lib/puppet/pops/issues.rb +4 -0
  164. data/vendored/puppet/lib/puppet/pops/loader/loader_paths.rb +2 -2
  165. data/vendored/puppet/lib/puppet/pops/loader/module_loaders.rb +17 -12
  166. data/vendored/puppet/lib/puppet/pops/loader/task_instantiator.rb +73 -45
  167. data/vendored/puppet/lib/puppet/pops/lookup/lookup_adapter.rb +55 -6
  168. data/vendored/puppet/lib/puppet/pops/model/model_label_provider.rb +2 -0
  169. data/vendored/puppet/lib/puppet/pops/parser/epp_parser.rb +1 -1
  170. data/vendored/puppet/lib/puppet/pops/parser/epp_support.rb +6 -2
  171. data/vendored/puppet/lib/puppet/pops/parser/lexer2.rb +1 -1
  172. data/vendored/puppet/lib/puppet/pops/pcore.rb +7 -7
  173. data/vendored/puppet/lib/puppet/pops/puppet_stack.rb +15 -1
  174. data/vendored/puppet/lib/puppet/pops/serialization.rb +2 -2
  175. data/vendored/puppet/lib/puppet/pops/serialization/from_data_converter.rb +2 -2
  176. data/vendored/puppet/lib/puppet/pops/serialization/json.rb +7 -7
  177. data/vendored/puppet/lib/puppet/pops/serialization/to_data_converter.rb +5 -5
  178. data/vendored/puppet/lib/puppet/pops/types/types.rb +8 -4
  179. data/vendored/puppet/lib/puppet/pops/validation/checker4_0.rb +73 -0
  180. data/vendored/puppet/lib/puppet/pops/validation/validator_factory_4_0.rb +4 -3
  181. data/vendored/puppet/lib/puppet/provider/augeas/augeas.rb +7 -0
  182. data/vendored/puppet/lib/puppet/provider/service/systemd.rb +1 -1
  183. data/vendored/puppet/lib/puppet/provider/user/aix.rb +2 -2
  184. data/vendored/puppet/lib/puppet/provider/yumrepo/inifile.rb +21 -9
  185. data/vendored/puppet/lib/puppet/reference/providers.rb +1 -1
  186. data/vendored/puppet/lib/puppet/reference/report.rb +1 -1
  187. data/vendored/puppet/lib/puppet/resource.rb +1 -1
  188. data/vendored/puppet/lib/puppet/resource/capability_finder.rb +4 -4
  189. data/vendored/puppet/lib/puppet/resource/catalog.rb +6 -3
  190. data/vendored/puppet/lib/puppet/resource/type.rb +6 -2
  191. data/vendored/puppet/lib/puppet/rest/client.rb +79 -0
  192. data/vendored/puppet/lib/puppet/rest/errors.rb +14 -0
  193. data/vendored/puppet/lib/puppet/rest/response.rb +29 -0
  194. data/vendored/puppet/lib/puppet/rest/route.rb +102 -0
  195. data/vendored/puppet/lib/puppet/rest/routes.rb +31 -0
  196. data/vendored/puppet/lib/puppet/settings.rb +9 -5
  197. data/vendored/puppet/lib/puppet/settings/config_file.rb +1 -1
  198. data/vendored/puppet/lib/puppet/settings/environment_conf.rb +10 -1
  199. data/vendored/puppet/lib/puppet/ssl.rb +0 -1
  200. data/vendored/puppet/lib/puppet/ssl/certificate.rb +6 -2
  201. data/vendored/puppet/lib/puppet/ssl/certificate_authority.rb +3 -3
  202. data/vendored/puppet/lib/puppet/ssl/host.rb +258 -19
  203. data/vendored/puppet/lib/puppet/ssl/validator/default_validator.rb +33 -19
  204. data/vendored/puppet/lib/puppet/syntax_checkers/json.rb +1 -1
  205. data/vendored/puppet/lib/puppet/transaction/event.rb +34 -7
  206. data/vendored/puppet/lib/puppet/transaction/report.rb +17 -14
  207. data/vendored/puppet/lib/puppet/type.rb +20 -12
  208. data/vendored/puppet/lib/puppet/type/file.rb +1 -1
  209. data/vendored/puppet/lib/puppet/type/file/content.rb +15 -2
  210. data/vendored/puppet/lib/puppet/type/file/ensure.rb +1 -1
  211. data/vendored/puppet/lib/puppet/type/schedule.rb +1 -1
  212. data/vendored/puppet/lib/puppet/type/stage.rb +1 -1
  213. data/vendored/puppet/lib/puppet/type/tidy.rb +5 -1
  214. data/vendored/puppet/lib/puppet/type/user.rb +35 -18
  215. data/vendored/puppet/lib/puppet/type/yumrepo.rb +8 -17
  216. data/vendored/puppet/lib/puppet/util.rb +0 -1
  217. data/vendored/puppet/lib/puppet/util/autoload.rb +1 -6
  218. data/vendored/puppet/lib/puppet/util/checksums.rb +0 -2
  219. data/vendored/puppet/lib/puppet/util/classgen.rb +0 -6
  220. data/vendored/puppet/lib/puppet/util/fileparsing.rb +27 -5
  221. data/vendored/puppet/lib/puppet/util/instance_loader.rb +3 -3
  222. data/vendored/puppet/lib/puppet/util/json.rb +77 -0
  223. data/vendored/puppet/lib/puppet/util/json_lockfile.rb +3 -3
  224. data/vendored/puppet/lib/puppet/util/ldap/connection.rb +7 -7
  225. data/vendored/puppet/lib/puppet/util/log/destinations.rb +2 -2
  226. data/vendored/puppet/lib/puppet/util/logging.rb +1 -1
  227. data/vendored/puppet/lib/puppet/util/plist.rb +1 -1
  228. data/vendored/puppet/lib/puppet/util/provider_features.rb +2 -5
  229. data/vendored/puppet/lib/puppet/util/reference.rb +5 -4
  230. data/vendored/puppet/lib/puppet/util/tagging.rb +16 -3
  231. data/vendored/puppet/lib/puppet/version.rb +1 -1
  232. metadata +44 -26
  233. data/vendored/puppet/lib/puppet/application/master.rb +0 -317
  234. data/vendored/puppet/lib/puppet/feature/rack.rb +0 -19
  235. data/vendored/puppet/lib/puppet/network/http/api/ca.rb +0 -2
  236. data/vendored/puppet/lib/puppet/network/http/api/ca/v1.rb +0 -11
  237. data/vendored/puppet/lib/puppet/network/http/rack.rb +0 -33
  238. data/vendored/puppet/lib/puppet/network/http/rack/rest.rb +0 -162
  239. data/vendored/puppet/lib/puppet/network/http/webrick.rb +0 -124
  240. data/vendored/puppet/lib/puppet/network/http/webrick/rest.rb +0 -114
  241. data/vendored/puppet/lib/puppet/network/server.rb +0 -39
  242. data/vendored/puppet/lib/puppet/ssl/configuration.rb +0 -61
  243. data/vendored/puppet/lib/puppet/util/methodhelper.rb +0 -32
  244. data/vendored/puppet/lib/puppet/vendor/load_semantic.rb +0 -1
  245. data/vendored/puppet/lib/puppet/vendor/load_semantic_puppet.rb +0 -1
  246. data/vendored/puppet/lib/puppet/vendor/semantic/lib/semantic.rb +0 -5
  247. data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet.rb +0 -11
  248. data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency.rb +0 -181
  249. data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency/graph.rb +0 -60
  250. data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency/graph_node.rb +0 -117
  251. data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency/module_release.rb +0 -58
  252. data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency/source.rb +0 -25
  253. data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency/unsatisfiable_graph.rb +0 -31
  254. data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/gem_version.rb +0 -3
  255. data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version.rb +0 -203
  256. data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb +0 -758
@@ -93,8 +93,6 @@ module Manager
93
93
  end
94
94
  end
95
95
 
96
- options = symbolize_options(options)
97
-
98
96
  # Then create the class.
99
97
 
100
98
  klass = genclass(
@@ -1,6 +1,6 @@
1
1
  require 'puppet/util/logging'
2
2
  require 'puppet/module/task'
3
- require 'json'
3
+ require 'puppet/util/json'
4
4
  require 'semantic_puppet/gem_version'
5
5
 
6
6
  # Support for modules
@@ -56,29 +56,8 @@ class Puppet::Module
56
56
  end
57
57
 
58
58
  # @api private
59
- def self.parse_range(range, strict)
60
- @parse_range_method ||= SemanticPuppet::VersionRange.method(:parse)
61
- if @parse_range_method.arity == 1
62
- @semver_gem_version ||= SemanticPuppet::Version.parse(SemanticPuppet::VERSION)
63
-
64
- # Give user a heads-up if the desired strict setting cannot be honored
65
- if strict
66
- if @semver_gem_version.major < 1
67
- Puppet.warn_once('strict_version_ranges', 'version_range_cannot_be_strict',
68
- _('VersionRanges will never be strict when using non-vendored SemanticPuppet gem, version %{version}') % { version: @semver_gem_version},
69
- :default, :default, :notice)
70
- end
71
- else
72
- if @semver_gem_version.major >= 1
73
- Puppet.warn_once('strict_version_ranges', 'version_range_always_strict',
74
- _('VersionRanges will always be strict when using non-vendored SemanticPuppet gem, version %{version}') % { version: @semver_gem_version},
75
- :default, :default, :notice)
76
- end
77
- end
78
- @parse_range_method.call(range)
79
- else
80
- @parse_range_method.call(range, strict)
81
- end
59
+ def self.parse_range(range)
60
+ SemanticPuppet::VersionRange.parse(range)
82
61
  end
83
62
 
84
63
  attr_reader :name, :environment, :path, :metadata, :tasks
@@ -87,10 +66,9 @@ class Puppet::Module
87
66
  attr_accessor :dependencies, :forge_name
88
67
  attr_accessor :source, :author, :version, :license, :summary, :description, :project_page
89
68
 
90
- def initialize(name, path, environment, strict_semver = true)
69
+ def initialize(name, path, environment)
91
70
  @name = name
92
71
  @path = path
93
- @strict_semver = strict_semver
94
72
  @environment = environment
95
73
 
96
74
  assert_validity
@@ -202,10 +180,10 @@ class Puppet::Module
202
180
 
203
181
  def read_metadata
204
182
  md_file = metadata_file
205
- md_file.nil? ? {} : JSON.parse(File.read(md_file, :encoding => 'utf-8'))
183
+ md_file.nil? ? {} : Puppet::Util::Json.load(File.read(md_file, :encoding => 'utf-8'))
206
184
  rescue Errno::ENOENT
207
185
  {}
208
- rescue JSON::JSONError => e
186
+ rescue Puppet::Util::Json::ParseError => e
209
187
  #TRANSLATORS 'metadata.json' is a specific file name and should not be translated.
210
188
  msg = _("%{name} has an invalid and unparsable metadata.json file. The parse error: %{error}") % { name: name, error: e.message }
211
189
  case Puppet[:strict]
@@ -406,7 +384,7 @@ class Puppet::Module
406
384
 
407
385
  if version_string
408
386
  begin
409
- required_version_semver_range = self.class.parse_range(version_string, @strict_semver)
387
+ required_version_semver_range = self.class.parse_range(version_string)
410
388
  actual_version_semver = SemanticPuppet::Version.parse(dep_mod.version)
411
389
  rescue ArgumentError
412
390
  error_details[:reason] = :non_semantic_version
@@ -432,10 +410,6 @@ class Puppet::Module
432
410
  self.environment == other.environment
433
411
  end
434
412
 
435
- def strict_semver?
436
- @strict_semver
437
- end
438
-
439
413
  private
440
414
 
441
415
  def wanted_manifests_from(pattern)
@@ -1,4 +1,3 @@
1
- require 'json'
2
1
  require 'puppet/util/logging'
3
2
 
4
3
  class Puppet::Module
@@ -131,8 +131,6 @@ module Puppet
131
131
  # Note: environment will have expanded the path
132
132
  options[:target_dir] = face_environment.full_modulepath.first
133
133
 
134
- # Default false to retain backward compatibility with SemanticPuppet 0.1.4
135
- options[:strict_semver] = false unless options.include?(:strict_semver)
136
134
  end
137
135
 
138
136
  # Given a hash of options, we should discover or create a
@@ -165,16 +163,15 @@ module Puppet
165
163
  # @param where [String] a description of the thing we're parsing the
166
164
  # dependency expression for
167
165
  # @param dep [Hash] the dependency description to parse
168
- # @param strict_semver [Boolean] set to `false` to relax range semantics to include pre-releases
169
166
  # @return [Array(String, SemanticPuppet::VersionRange, String)] a tuple of the
170
167
  # dependent module's name, the version range dependency, and the
171
168
  # unparsed range expression.
172
- def self.parse_module_dependency(where, dep, strict_semver = true)
169
+ def self.parse_module_dependency(where, dep)
173
170
  dep_name = dep['name'].tr('/', '-')
174
171
  range = dep['version_requirement'] || '>= 0.0.0'
175
172
 
176
173
  begin
177
- parsed_range = Module.parse_range(range, strict_semver)
174
+ parsed_range = Module.parse_range(range)
178
175
  rescue ArgumentError => e
179
176
  Puppet.debug "Error in #{where} parsing dependency #{dep_name} (#{e.message}); using empty range."
180
177
  parsed_range = SemanticPuppet::VersionRange::EMPTY_RANGE
@@ -1,5 +1,5 @@
1
1
  require 'net/http'
2
- require 'json'
2
+ require 'puppet/util/json'
3
3
  require 'puppet/util/colors'
4
4
 
5
5
  module Puppet::ModuleTool
@@ -26,7 +26,7 @@ module Puppet::ModuleTool
26
26
  when Net::HTTPOK, Net::HTTPCreated
27
27
  Puppet.notice success
28
28
  else
29
- errors = JSON.parse(response.body)['error'] rescue "HTTP #{response.code}, #{response.body}"
29
+ errors = Puppet::Util::Json.load(response.body)['error'] rescue "HTTP #{response.code}, #{response.body}"
30
30
  Puppet.warning "#{failure} (#{errors})"
31
31
  end
32
32
  end
@@ -40,7 +40,7 @@ module Puppet::ModuleTool
40
40
  end
41
41
 
42
42
  if require_metadata && !Puppet::ModuleTool.is_module_root?(@path)
43
- raise ArgumentError, _("Unable to find metadata.json in module root at %{path} See https://docs.puppet.com/puppet/latest/reference/modules_publishing.html for required file format.") % { path: @path }
43
+ raise ArgumentError, _("Unable to find metadata.json in module root at %{path} See https://puppet.com/docs/puppet/latest/modules_publishing.html for required file format.") % { path: @path }
44
44
  end
45
45
 
46
46
  metadata_path = File.join(@path, 'metadata.json')
@@ -48,8 +48,8 @@ module Puppet::ModuleTool
48
48
  if File.file?(metadata_path)
49
49
  File.open(metadata_path) do |f|
50
50
  begin
51
- @metadata.update(JSON.load(f))
52
- rescue JSON::ParserError => ex
51
+ @metadata.update(Puppet::Util::Json.load(f))
52
+ rescue Puppet::Util::Json::ParserError => ex
53
53
  raise ArgumentError, _("Could not parse JSON %{metadata_path}") % { metadata_path: metadata_path }, ex.backtrace
54
54
  end
55
55
  end
@@ -1,5 +1,5 @@
1
1
  require 'fileutils'
2
- require 'json'
2
+ require 'puppet/util/json'
3
3
  require 'puppet/file_system'
4
4
  require 'pathspec'
5
5
  require 'facter'
@@ -140,7 +140,7 @@ module Puppet::ModuleTool
140
140
  end
141
141
 
142
142
  Puppet::FileSystem.open(File.join(build_path, 'checksums.json'), nil, 'wb') do |f|
143
- f.write(JSON.pretty_generate(Checksums.new(build_path)))
143
+ f.write(Puppet::Util::Json.dump(Checksums.new(build_path), :pretty => true))
144
144
  end
145
145
  end
146
146
 
@@ -1,4 +1,4 @@
1
- require 'json'
1
+ require 'puppet/util/json'
2
2
  require 'puppet/module_tool/checksums'
3
3
 
4
4
  module Puppet::ModuleTool
@@ -40,10 +40,10 @@ module Puppet::ModuleTool
40
40
 
41
41
  def checksums
42
42
  if checksums_file.exist?
43
- JSON.parse(checksums_file.read)
43
+ Puppet::Util::Json.load(checksums_file.read)
44
44
  elsif metadata_file.exist?
45
45
  # Check metadata.json too; legacy modules store their checksums there.
46
- JSON.parse(metadata_file.read)['checksums'] or
46
+ Puppet::Util::Json.load(metadata_file.read)['checksums'] or
47
47
  raise ArgumentError, _("No file containing checksums found.")
48
48
  else
49
49
  raise ArgumentError, _("No file containing checksums found.")
@@ -25,7 +25,6 @@ module Puppet::ModuleTool
25
25
  @ignore_dependencies = forced? || options[:ignore_dependencies]
26
26
  @name = name
27
27
  @install_dir = install_dir
28
- @strict_semver = !!options[:strict_semver]
29
28
 
30
29
  Puppet::Forge::Cache.clean
31
30
 
@@ -63,7 +62,7 @@ module Puppet::ModuleTool
63
62
  begin
64
63
  if installed_module = installed_modules[name]
65
64
  unless forced?
66
- if Puppet::Module.parse_range(version, @strict_semver).include? installed_module.version
65
+ if Puppet::Module.parse_range(version).include? installed_module.version
67
66
  results[:result] = :noop
68
67
  results[:version] = installed_module.version
69
68
  return results
@@ -107,7 +106,7 @@ module Puppet::ModuleTool
107
106
  # locking it to upgrades within the same major version.
108
107
  installed_range = ">=#{version} #{version.major}.x"
109
108
  graph.add_constraint('installed', mod, installed_range) do |node|
110
- Puppet::Module.parse_range(installed_range, @strict_semver).include? node.version
109
+ Puppet::Module.parse_range(installed_range).include? node.version
111
110
  end
112
111
 
113
112
  release.mod.dependencies.each do |dep|
@@ -115,7 +114,7 @@ module Puppet::ModuleTool
115
114
 
116
115
  range = dep['version_requirement']
117
116
  graph.add_constraint("#{mod} constraint", dep_name, range) do |node|
118
- Puppet::Module.parse_range(range, @strict_semver).include? node.version
117
+ Puppet::Module.parse_range(range).include? node.version
119
118
  end
120
119
  end
121
120
  end
@@ -189,12 +188,12 @@ module Puppet::ModuleTool
189
188
  private
190
189
 
191
190
  def module_repository
192
- @repo ||= Puppet::Forge.new(Puppet[:module_repository], @strict_semver)
191
+ @repo ||= Puppet::Forge.new(Puppet[:module_repository])
193
192
  end
194
193
 
195
194
  def local_tarball_source
196
195
  @tarball_source ||= begin
197
- Puppet::ModuleTool::LocalTarball.new(@name, @strict_semver)
196
+ Puppet::ModuleTool::LocalTarball.new(@name)
198
197
  rescue Puppet::Module::Error => e
199
198
  raise InvalidModuleError.new(@name, :action => @action, :error => e)
200
199
  end
@@ -209,7 +208,7 @@ module Puppet::ModuleTool
209
208
  end
210
209
 
211
210
  def build_single_module_graph(name, version)
212
- range = Puppet::Module.parse_range(version, @strict_semver)
211
+ range = Puppet::Module.parse_range(version)
213
212
  graph = SemanticPuppet::Dependency::Graph.new(name => range)
214
213
  releases = SemanticPuppet::Dependency.fetch_releases(name)
215
214
  releases.each { |release| release.dependencies.clear }
@@ -12,7 +12,6 @@ module Puppet::ModuleTool
12
12
  @suggestions = []
13
13
  @environment = options[:environment_instance]
14
14
  @ignore_changes = options[:force] || options[:ignore_changes]
15
- @strict_semver = !!options[:strict_semver]
16
15
  end
17
16
 
18
17
  def run
@@ -61,7 +60,7 @@ module Puppet::ModuleTool
61
60
  :path => mod.modulepath,
62
61
  }
63
62
  if @options[:version] && mod.version
64
- next unless Puppet::Module.parse_range(@options[:version], @strict_semver).include?(SemanticPuppet::Version.parse(mod.version))
63
+ next unless Puppet::Module.parse_range(@options[:version]).include?(SemanticPuppet::Version.parse(mod.version))
65
64
  end
66
65
  @installed << mod
67
66
  elsif mod_name =~ /#{@name}/
@@ -1,6 +1,6 @@
1
1
  require 'pathname'
2
2
  require 'tmpdir'
3
- require 'json'
3
+ require 'puppet/util/json'
4
4
  require 'puppet/file_system'
5
5
 
6
6
  module Puppet::ModuleTool
@@ -75,7 +75,7 @@ module Puppet::ModuleTool
75
75
 
76
76
  # @api private
77
77
  def module_name
78
- metadata = JSON.parse((root_dir + 'metadata.json').read)
78
+ metadata = Puppet::Util::Json.load((root_dir + 'metadata.json').read)
79
79
  metadata['name'][/-(.*)/, 1]
80
80
  end
81
81
 
@@ -20,7 +20,6 @@ module Puppet::ModuleTool
20
20
  @name = name
21
21
  @ignore_changes = forced? || options[:ignore_changes]
22
22
  @ignore_dependencies = forced? || options[:ignore_dependencies]
23
- @strict_semver = !!options[:strict_semver]
24
23
 
25
24
  SemanticPuppet::Dependency.add_source(installed_modules_source)
26
25
  SemanticPuppet::Dependency.add_source(module_repository)
@@ -94,7 +93,7 @@ module Puppet::ModuleTool
94
93
  if available_versions.empty?
95
94
  raise NoCandidateReleasesError, results.merge(:module_name => name, :source => module_repository.host)
96
95
  elsif results[:requested_version] != :latest
97
- requested = Puppet::Module.parse_range(results[:requested_version], @strict_semver)
96
+ requested = Puppet::Module.parse_range(results[:requested_version])
98
97
  unless available_versions.any? {|m| requested.include? m.version}
99
98
  raise NoCandidateReleasesError, results.merge(:module_name => name, :source => module_repository.host)
100
99
  end
@@ -123,7 +122,7 @@ module Puppet::ModuleTool
123
122
  # module, locking it to upgrades within the same major version.
124
123
  installed_range = ">=#{version} #{version.major}.x"
125
124
  graph.add_constraint('installed', installed_module, installed_range) do |node|
126
- Puppet::Module.parse_range(installed_range, @strict_semver).include? node.version
125
+ Puppet::Module.parse_range(installed_range).include? node.version
127
126
  end
128
127
 
129
128
  release.mod.dependencies.each do |dep|
@@ -131,7 +130,7 @@ module Puppet::ModuleTool
131
130
 
132
131
  range = dep['version_requirement']
133
132
  graph.add_constraint("#{installed_module} constraint", dep_name, range) do |node|
134
- Puppet::Module.parse_range(range, @strict_semver).include? node.version
133
+ Puppet::Module.parse_range(range).include? node.version
135
134
  end
136
135
  end
137
136
  end
@@ -219,7 +218,7 @@ module Puppet::ModuleTool
219
218
 
220
219
  private
221
220
  def module_repository
222
- @repo ||= Puppet::Forge.new(Puppet[:module_repository], @strict_semver)
221
+ @repo ||= Puppet::Forge.new(Puppet[:module_repository])
223
222
  end
224
223
 
225
224
  def installed_modules_source
@@ -231,7 +230,7 @@ module Puppet::ModuleTool
231
230
  end
232
231
 
233
232
  def build_single_module_graph(name, version)
234
- range = Puppet::Module.parse_range(version, @strict_semver)
233
+ range = Puppet::Module.parse_range(version)
235
234
  graph = SemanticPuppet::Dependency::Graph.new(name => range)
236
235
  releases = SemanticPuppet::Dependency.fetch_releases(name)
237
236
  releases.each { |release| release.dependencies.clear }
@@ -16,7 +16,7 @@ module Puppet::ModuleTool
16
16
  # TODO: add error checking, the next line raises ArgumentError when +full_module_name+ is invalid
17
17
  @username, @name = Puppet::ModuleTool.username_and_modname_from(full_module_name)
18
18
  @version_requirement = version_requirement
19
- @repository = repository ? Puppet::Forge::Repository.new(repository) : nil
19
+ @repository = repository ? Puppet::Forge::Repository.new(repository, nil) : nil
20
20
  end
21
21
 
22
22
  # We override Object's ==, eql, and hash so we can more easily find identical
@@ -54,7 +54,7 @@ module Puppet::ModuleTool
54
54
  class ModuleRelease < SemanticPuppet::Dependency::ModuleRelease
55
55
  attr_reader :mod, :metadata
56
56
 
57
- def initialize(source, mod, strict_semver = true)
57
+ def initialize(source, mod)
58
58
  @mod = mod
59
59
  @metadata = mod.metadata
60
60
  name = mod.forge_name.tr('/', '-')
@@ -70,7 +70,7 @@ module Puppet::ModuleTool
70
70
 
71
71
  if mod.dependencies
72
72
  mod.dependencies.each do |dependency|
73
- results = Puppet::ModuleTool.parse_module_dependency(release, dependency, strict_semver)
73
+ results = Puppet::ModuleTool.parse_module_dependency(release, dependency)
74
74
  dep_name, parsed_range, range = results
75
75
 
76
76
  add_constraint('initialize', dep_name, range.to_s) do |node|
@@ -8,11 +8,11 @@ module Puppet::ModuleTool
8
8
  class LocalTarball < SemanticPuppet::Dependency::Source
9
9
  attr_accessor :release
10
10
 
11
- def initialize(filename, strict_semver = true)
11
+ def initialize(filename)
12
12
  unpack(filename, tmpdir)
13
13
  Puppet.debug "Unpacked local tarball to #{tmpdir}"
14
14
 
15
- mod = Puppet::Module.new('tarball', tmpdir, nil, strict_semver)
15
+ mod = Puppet::Module.new('tarball', tmpdir, nil)
16
16
  @release = ModuleRelease.new(self, mod)
17
17
  end
18
18
 
@@ -52,7 +52,7 @@ module Puppet::ModuleTool
52
52
 
53
53
  if mod.dependencies
54
54
  dependencies = mod.dependencies.map do |dep|
55
- Puppet::ModuleTool.parse_module_dependency(release, dep, mod.strict_semver?)[0..1]
55
+ Puppet::ModuleTool.parse_module_dependency(release, dep)[0..1]
56
56
  end
57
57
  dependencies = Hash[dependencies]
58
58
  end
@@ -1,8 +1,7 @@
1
- require 'puppet/util/methodhelper'
2
1
  require 'puppet/module_tool'
3
2
  require 'puppet/network/format_support'
4
3
  require 'uri'
5
- require 'json'
4
+ require 'puppet/util/json'
6
5
  require 'set'
7
6
 
8
7
  module Puppet::ModuleTool
@@ -102,8 +101,8 @@ module Puppet::ModuleTool
102
101
  data = @data.dup.merge('dependencies' => dependencies)
103
102
 
104
103
  contents = data.keys.map do |k|
105
- value = (JSON.pretty_generate(data[k]) rescue data[k].to_json)
106
- "#{k.to_json}: #{value}"
104
+ value = (Puppet::Util::Json.dump(data[k], :pretty => true) rescue data[k].to_json)
105
+ %Q("#{k.to_s}": #{value})
107
106
  end
108
107
 
109
108
  "{\n" + contents.join(",\n").gsub(/^/, ' ') + "\n}\n"
@@ -76,10 +76,10 @@ module Puppet::ModuleTool::Shared
76
76
  }
77
77
 
78
78
  if forced?
79
- range = Puppet::Module.parse_range(@version, @strict_semver) rescue Puppet::Module.parse_range('>= 0.0.0', @strict_semver)
79
+ range = Puppet::Module.parse_range(@version) rescue Puppet::Module.parse_range('>= 0.0.0')
80
80
  else
81
81
  range = (@conditions[mod]).map do |r|
82
- Puppet::Module.parse_range(r[:dependency], @strict_semver) rescue Puppet::Module.parse_range('>= 0.0.0', @strict_semver)
82
+ Puppet::Module.parse_range(r[:dependency]) rescue Puppet::Module.parse_range('>= 0.0.0')
83
83
  end.inject(&:&)
84
84
  end
85
85
 
@@ -10,10 +10,6 @@ module Puppet
10
10
  Puppet::Network::HTTP::MASTER_URL_PREFIX
11
11
  end
12
12
 
13
- def self.ca_url_prefix
14
- Puppet::Network::HTTP::CA_URL_PREFIX
15
- end
16
-
17
13
  def self.default_acl
18
14
  [
19
15
  # Master API V3
@@ -28,15 +24,6 @@ module Puppet
28
24
  { :acl => "#{master_url_prefix}/v3/file" },
29
25
 
30
26
  { :acl => "#{master_url_prefix}/v3/status", :method => [:find], :authenticated => true },
31
-
32
- # CA API V1
33
- { :acl => "#{ca_url_prefix}/v1/certificate_revocation_list/ca", :method => :find, :authenticated => true },
34
-
35
- # These allow `auth any`, because if you can do them anonymously you
36
- # should probably also be able to do them when trusted.
37
- { :acl => "#{ca_url_prefix}/v1/certificate/ca", :method => :find, :authenticated => :any },
38
- { :acl => "#{ca_url_prefix}/v1/certificate/", :method => :find, :authenticated => :any },
39
- { :acl => "#{ca_url_prefix}/v1/certificate_request", :method => [:find, :save], :authenticated => :any },
40
27
  ]
41
28
  end
42
29