puppet 5.3.7-x64-mingw32 → 5.4.0-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 (454) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +42 -29
  3. data/README.md +8 -6
  4. data/ext/cert_inspector +2 -2
  5. data/ext/envpuppet +1 -1
  6. data/ext/gentoo/init.d/puppetmaster +4 -4
  7. data/ext/ips/puppet-agent +11 -11
  8. data/ext/ips/puppet-master +11 -11
  9. data/ext/puppet-test +1 -2
  10. data/ext/redhat/client.init +2 -2
  11. data/ext/redhat/logrotate +1 -1
  12. data/ext/solaris/smf/puppet +11 -11
  13. data/ext/solaris/smf/svc-puppetd +5 -5
  14. data/ext/solaris/smf/svc-puppetmasterd +5 -5
  15. data/ext/windows/service/daemon.rb +1 -1
  16. data/install.rb +2 -3
  17. data/lib/puppet/agent.rb +1 -1
  18. data/lib/puppet/application/cert.rb +1 -3
  19. data/lib/puppet/application/describe.rb +0 -1
  20. data/lib/puppet/application/device.rb +12 -99
  21. data/lib/puppet/application/filebucket.rb +32 -11
  22. data/lib/puppet/application/lookup.rb +1 -11
  23. data/lib/puppet/application/script.rb +261 -0
  24. data/lib/puppet/configurer.rb +3 -4
  25. data/lib/puppet/configurer/plugin_handler.rb +26 -9
  26. data/lib/puppet/context.rb +1 -1
  27. data/lib/puppet/datatypes.rb +213 -0
  28. data/lib/puppet/datatypes/error.rb +21 -0
  29. data/lib/puppet/datatypes/impl/error.rb +40 -0
  30. data/lib/puppet/defaults.rb +51 -20
  31. data/lib/puppet/environments.rb +17 -0
  32. data/lib/puppet/error.rb +17 -0
  33. data/lib/puppet/etc.rb +2 -2
  34. data/lib/puppet/external/pson/pure/generator.rb +1 -1
  35. data/lib/puppet/external/pson/pure/parser.rb +1 -1
  36. data/lib/puppet/face/config.rb +45 -0
  37. data/lib/puppet/face/epp.rb +3 -3
  38. data/lib/puppet/face/help/action.erb +3 -0
  39. data/lib/puppet/face/module/build.rb +1 -0
  40. data/lib/puppet/face/module/generate.rb +5 -0
  41. data/lib/puppet/face/module/install.rb +1 -0
  42. data/lib/puppet/face/module/search.rb +6 -2
  43. data/lib/puppet/face/module/uninstall.rb +1 -0
  44. data/lib/puppet/face/module/upgrade.rb +1 -0
  45. data/lib/puppet/face/parser.rb +0 -1
  46. data/lib/puppet/face/plugin.rb +1 -3
  47. data/lib/puppet/feature/base.rb +1 -1
  48. data/lib/puppet/feature/bolt.rb +3 -0
  49. data/lib/puppet/file_bucket/dipper.rb +1 -2
  50. data/lib/puppet/file_serving/http_metadata.rb +1 -1
  51. data/lib/puppet/file_system/uniquefile.rb +2 -2
  52. data/lib/puppet/forge.rb +6 -0
  53. data/lib/puppet/functions.rb +70 -88
  54. data/lib/puppet/functions/all.rb +6 -2
  55. data/lib/puppet/functions/annotate.rb +1 -1
  56. data/lib/puppet/functions/any.rb +7 -3
  57. data/lib/puppet/functions/contain.rb +6 -0
  58. data/lib/puppet/functions/convert_to.rb +32 -0
  59. data/lib/puppet/functions/defined.rb +0 -3
  60. data/lib/puppet/functions/each.rb +10 -6
  61. data/lib/puppet/functions/filter.rb +16 -10
  62. data/lib/puppet/functions/find_file.rb +0 -1
  63. data/lib/puppet/functions/include.rb +6 -0
  64. data/lib/puppet/functions/map.rb +12 -9
  65. data/lib/puppet/functions/module_directory.rb +41 -0
  66. data/lib/puppet/functions/new.rb +1 -4
  67. data/lib/puppet/functions/regsubst.rb +1 -1
  68. data/lib/puppet/functions/require.rb +6 -0
  69. data/lib/puppet/generate/type.rb +1 -1
  70. data/lib/puppet/gettext/config.rb +2 -2
  71. data/lib/puppet/gettext/stubs.rb +1 -1
  72. data/lib/puppet/indirector/catalog/compiler.rb +0 -1
  73. data/lib/puppet/indirector/file_bucket_file/file.rb +6 -2
  74. data/lib/puppet/indirector/file_server.rb +1 -1
  75. data/lib/puppet/indirector/node/ldap.rb +19 -3
  76. data/lib/puppet/indirector/request.rb +10 -6
  77. data/lib/puppet/indirector/rest.rb +11 -12
  78. data/lib/puppet/info_service/class_information_service.rb +1 -1
  79. data/lib/puppet/interface/action.rb +11 -0
  80. data/lib/puppet/interface/action_builder.rb +8 -0
  81. data/lib/puppet/interface/option_manager.rb +1 -1
  82. data/lib/puppet/loaders.rb +2 -0
  83. data/lib/puppet/module.rb +6 -2
  84. data/lib/puppet/module_tool/applications/builder.rb +4 -0
  85. data/lib/puppet/module_tool/applications/installer.rb +3 -0
  86. data/lib/puppet/module_tool/applications/uninstaller.rb +3 -0
  87. data/lib/puppet/module_tool/applications/unpacker.rb +1 -1
  88. data/lib/puppet/module_tool/applications/upgrader.rb +3 -0
  89. data/lib/puppet/module_tool/installed_modules.rb +1 -1
  90. data/lib/puppet/module_tool/metadata.rb +0 -1
  91. data/lib/puppet/network/authstore.rb +1 -1
  92. data/lib/puppet/network/http/api/indirected_routes.rb +1 -1
  93. data/lib/puppet/network/http/connection.rb +1 -9
  94. data/lib/puppet/network/http/factory.rb +0 -3
  95. data/lib/puppet/network/http/webrick.rb +1 -0
  96. data/lib/puppet/network/rights.rb +1 -1
  97. data/lib/puppet/node.rb +53 -0
  98. data/lib/puppet/node/environment.rb +1 -1
  99. data/lib/puppet/parameter/boolean.rb +1 -1
  100. data/lib/puppet/parser.rb +1 -0
  101. data/lib/puppet/parser/abstract_compiler.rb +36 -0
  102. data/lib/puppet/parser/ast/branch.rb +1 -1
  103. data/lib/puppet/parser/ast/pops_bridge.rb +8 -52
  104. data/lib/puppet/parser/compiler.rb +4 -54
  105. data/lib/puppet/parser/functions.rb +0 -1
  106. data/lib/puppet/parser/functions/create_resources.rb +6 -0
  107. data/lib/puppet/parser/functions/fqdn_rand.rb +6 -2
  108. data/lib/puppet/parser/functions/inline_template.rb +6 -0
  109. data/lib/puppet/parser/functions/new.rb +47 -32
  110. data/lib/puppet/parser/functions/realize.rb +6 -0
  111. data/lib/puppet/parser/functions/return.rb +1 -22
  112. data/lib/puppet/parser/functions/reverse_each.rb +1 -1
  113. data/lib/puppet/parser/functions/scanf.rb +1 -1
  114. data/lib/puppet/parser/functions/sha256.rb +5 -0
  115. data/lib/puppet/parser/functions/tag.rb +6 -0
  116. data/lib/puppet/parser/functions/tagged.rb +6 -0
  117. data/lib/puppet/parser/functions/template.rb +5 -0
  118. data/lib/puppet/parser/scope.rb +28 -4
  119. data/lib/puppet/parser/script_compiler.rb +118 -0
  120. data/lib/puppet/parser/type_loader.rb +1 -1
  121. data/lib/puppet/pops.rb +1 -1
  122. data/lib/puppet/pops/evaluator/access_operator.rb +38 -4
  123. data/lib/puppet/pops/evaluator/closure.rb +12 -4
  124. data/lib/puppet/pops/evaluator/compare_operator.rb +4 -4
  125. data/lib/puppet/pops/evaluator/epp_evaluator.rb +13 -0
  126. data/lib/puppet/pops/evaluator/evaluator_impl.rb +38 -10
  127. data/lib/puppet/pops/evaluator/literal_evaluator.rb +1 -1
  128. data/lib/puppet/pops/evaluator/runtime3_converter.rb +1 -1
  129. data/lib/puppet/pops/evaluator/runtime3_support.rb +2 -3
  130. data/lib/puppet/pops/functions/dispatch.rb +6 -5
  131. data/lib/puppet/pops/functions/function.rb +2 -2
  132. data/lib/puppet/pops/issues.rb +34 -2
  133. data/lib/puppet/pops/loader/base_loader.rb +10 -0
  134. data/lib/puppet/pops/loader/dependency_loader.rb +7 -0
  135. data/lib/puppet/pops/loader/loader.rb +21 -2
  136. data/lib/puppet/pops/loader/loader_paths.rb +180 -30
  137. data/lib/puppet/pops/loader/module_loaders.rb +202 -33
  138. data/lib/puppet/pops/loader/puppet_plan_instantiator.rb +84 -0
  139. data/lib/puppet/pops/loader/puppet_resource_type_impl_instantiator.rb +9 -9
  140. data/lib/puppet/pops/loader/ruby_data_type_instantiator.rb +40 -0
  141. data/lib/puppet/pops/loader/runtime3_type_loader.rb +6 -1
  142. data/lib/puppet/pops/loader/static_loader.rb +23 -8
  143. data/lib/puppet/pops/loader/task_instantiator.rb +69 -0
  144. data/lib/puppet/pops/loader/type_definition_instantiator.rb +4 -0
  145. data/lib/puppet/pops/loaders.rb +122 -11
  146. data/lib/puppet/pops/lookup/data_dig_function_provider.rb +1 -1
  147. data/lib/puppet/pops/lookup/interpolation.rb +1 -1
  148. data/lib/puppet/pops/lookup/lookup_adapter.rb +0 -1
  149. data/lib/puppet/pops/model/ast.pp +3 -0
  150. data/lib/puppet/pops/model/ast.rb +34 -1
  151. data/lib/puppet/pops/model/factory.rb +30 -3
  152. data/lib/puppet/pops/model/model_label_provider.rb +1 -0
  153. data/lib/puppet/pops/model/model_tree_dumper.rb +12 -1
  154. data/lib/puppet/pops/model/tree_dumper.rb +1 -1
  155. data/lib/puppet/pops/parser/code_merger.rb +2 -2
  156. data/lib/puppet/pops/parser/egrammar.ra +44 -15
  157. data/lib/puppet/pops/parser/eparser.rb +1687 -1571
  158. data/lib/puppet/pops/parser/epp_support.rb +1 -3
  159. data/lib/puppet/pops/parser/evaluating_parser.rb +1 -1
  160. data/lib/puppet/pops/parser/interpolation_support.rb +2 -2
  161. data/lib/puppet/pops/parser/lexer2.rb +4 -4
  162. data/lib/puppet/pops/parser/lexer_support.rb +2 -2
  163. data/lib/puppet/pops/parser/locatable.rb +1 -1
  164. data/lib/puppet/pops/parser/locator.rb +7 -13
  165. data/lib/puppet/pops/parser/parser_support.rb +3 -3
  166. data/lib/puppet/pops/parser/slurp_support.rb +0 -3
  167. data/lib/puppet/pops/pcore.rb +45 -0
  168. data/lib/puppet/pops/resource/param.rb +1 -1
  169. data/lib/puppet/pops/resource/resource_type_impl.rb +1 -1
  170. data/lib/puppet/pops/serialization/abstract_reader.rb +4 -0
  171. data/lib/puppet/pops/serialization/abstract_writer.rb +6 -0
  172. data/lib/puppet/pops/serialization/extension.rb +1 -0
  173. data/lib/puppet/pops/serialization/from_data_converter.rb +64 -10
  174. data/lib/puppet/pops/serialization/json_path.rb +2 -1
  175. data/lib/puppet/pops/serialization/object.rb +3 -4
  176. data/lib/puppet/pops/serialization/serializer.rb +2 -1
  177. data/lib/puppet/pops/serialization/to_data_converter.rb +7 -3
  178. data/lib/puppet/pops/time/timespan.rb +1 -1
  179. data/lib/puppet/pops/types/iterable.rb +38 -9
  180. data/lib/puppet/pops/types/p_init_type.rb +1 -1
  181. data/lib/puppet/pops/types/p_meta_type.rb +4 -0
  182. data/lib/puppet/pops/types/p_object_type.rb +146 -14
  183. data/lib/puppet/pops/types/p_object_type_extension.rb +218 -0
  184. data/lib/puppet/pops/types/p_sem_ver_range_type.rb +0 -1
  185. data/lib/puppet/pops/types/p_sem_ver_type.rb +10 -2
  186. data/lib/puppet/pops/types/p_type_set_type.rb +0 -1
  187. data/lib/puppet/pops/types/p_uri_type.rb +190 -0
  188. data/lib/puppet/pops/types/puppet_object.rb +15 -1
  189. data/lib/puppet/pops/types/ruby_generator.rb +46 -54
  190. data/lib/puppet/pops/types/string_converter.rb +22 -1
  191. data/lib/puppet/pops/types/type_acceptor.rb +1 -1
  192. data/lib/puppet/pops/types/type_calculator.rb +13 -4
  193. data/lib/puppet/pops/types/type_factory.rb +29 -5
  194. data/lib/puppet/pops/types/type_formatter.rb +67 -4
  195. data/lib/puppet/pops/types/type_parser.rb +92 -4
  196. data/lib/puppet/pops/types/type_with_members.rb +43 -0
  197. data/lib/puppet/pops/types/types.rb +212 -80
  198. data/lib/puppet/pops/validation/checker4_0.rb +10 -6
  199. data/lib/puppet/pops/validation/tasks_checker.rb +60 -0
  200. data/lib/puppet/pops/validation/validator_factory_4_0.rb +6 -1
  201. data/lib/puppet/property.rb +1 -1
  202. data/lib/puppet/provider.rb +18 -8
  203. data/lib/puppet/provider/augeas/augeas.rb +3 -4
  204. data/lib/puppet/provider/exec.rb +0 -2
  205. data/lib/puppet/provider/group/groupadd.rb +25 -1
  206. data/lib/puppet/provider/group/windows_adsi.rb +7 -4
  207. data/lib/puppet/provider/mount.rb +25 -8
  208. data/lib/puppet/provider/nameservice.rb +9 -4
  209. data/lib/puppet/provider/nameservice/directoryservice.rb +3 -3
  210. data/lib/puppet/provider/nameservice/objectadd.rb +13 -24
  211. data/lib/puppet/provider/nameservice/pw.rb +14 -14
  212. data/lib/puppet/provider/package/appdmg.rb +0 -1
  213. data/lib/puppet/provider/package/apple.rb +0 -1
  214. data/lib/puppet/provider/package/gem.rb +2 -2
  215. data/lib/puppet/provider/package/macports.rb +2 -2
  216. data/lib/puppet/provider/package/pkg.rb +3 -0
  217. data/lib/puppet/provider/package/pkgdmg.rb +0 -1
  218. data/lib/puppet/provider/package/portage.rb +0 -1
  219. data/lib/puppet/provider/package/yum.rb +23 -8
  220. data/lib/puppet/provider/package/zypper.rb +2 -2
  221. data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +2 -2
  222. data/lib/puppet/provider/service/init.rb +1 -0
  223. data/lib/puppet/provider/service/launchd.rb +6 -7
  224. data/lib/puppet/provider/service/redhat.rb +3 -2
  225. data/lib/puppet/provider/service/systemd.rb +2 -2
  226. data/lib/puppet/provider/ssh_authorized_key/parsed.rb +1 -1
  227. data/lib/puppet/provider/user/aix.rb +3 -2
  228. data/lib/puppet/provider/user/openbsd.rb +1 -1
  229. data/lib/puppet/provider/user/pw.rb +1 -1
  230. data/lib/puppet/provider/user/user_role_add.rb +7 -1
  231. data/lib/puppet/provider/user/useradd.rb +36 -6
  232. data/lib/puppet/provider/user/windows_adsi.rb +1 -1
  233. data/lib/puppet/provider/yumrepo/inifile.rb +2 -4
  234. data/lib/puppet/provider/zfs/zfs.rb +23 -3
  235. data/lib/puppet/provider/zpool/zpool.rb +1 -1
  236. data/lib/puppet/reference/configuration.rb +0 -2
  237. data/lib/puppet/reference/type.rb +0 -1
  238. data/lib/puppet/resource.rb +1 -2
  239. data/lib/puppet/resource/catalog.rb +1 -1
  240. data/lib/puppet/resource/status.rb +0 -1
  241. data/lib/puppet/resource/type.rb +4 -4
  242. data/lib/puppet/resource/type_collection.rb +1 -1
  243. data/lib/puppet/settings/base_setting.rb +1 -1
  244. data/lib/puppet/settings/environment_conf.rb +0 -1
  245. data/lib/puppet/settings/ini_file.rb +66 -12
  246. data/lib/puppet/ssl/certificate_authority.rb +1 -1
  247. data/lib/puppet/ssl/certificate_request.rb +2 -2
  248. data/lib/puppet/ssl/certificate_revocation_list.rb +2 -1
  249. data/lib/puppet/ssl/certificate_signer.rb +11 -0
  250. data/lib/puppet/ssl/host.rb +2 -2
  251. data/lib/puppet/syntax_checkers/base64.rb +1 -1
  252. data/lib/puppet/transaction.rb +37 -14
  253. data/lib/puppet/transaction/report.rb +3 -1
  254. data/lib/puppet/type.rb +17 -4
  255. data/lib/puppet/type/cron.rb +1 -1
  256. data/lib/puppet/type/exec.rb +5 -4
  257. data/lib/puppet/type/file.rb +3 -3
  258. data/lib/puppet/type/file/checksum.rb +7 -1
  259. data/lib/puppet/type/file/checksum_value.rb +4 -3
  260. data/lib/puppet/type/group.rb +3 -0
  261. data/lib/puppet/type/k5login.rb +101 -0
  262. data/lib/puppet/type/macauthorization.rb +1 -1
  263. data/lib/puppet/type/mount.rb +6 -2
  264. data/lib/puppet/type/tidy.rb +6 -4
  265. data/lib/puppet/type/user.rb +26 -39
  266. data/lib/puppet/type/yumrepo.rb +9 -0
  267. data/lib/puppet/type/zfs.rb +4 -0
  268. data/lib/puppet/util.rb +8 -15
  269. data/lib/puppet/util/character_encoding.rb +2 -2
  270. data/lib/puppet/util/checksums.rb +82 -1
  271. data/lib/puppet/util/errors.rb +0 -2
  272. data/lib/puppet/util/filetype.rb +2 -2
  273. data/lib/puppet/util/json_lockfile.rb +1 -1
  274. data/lib/puppet/util/log.rb +1 -1
  275. data/lib/puppet/util/log/destinations.rb +10 -1
  276. data/lib/puppet/util/monkey_patches.rb +1 -1
  277. data/lib/puppet/util/network_device/cisco/device.rb +5 -5
  278. data/lib/puppet/util/network_device/config.rb +2 -3
  279. data/lib/puppet/util/platform.rb +13 -0
  280. data/lib/puppet/util/plist.rb +4 -4
  281. data/lib/puppet/util/rdoc/generators/puppet_generator.rb +2 -2
  282. data/lib/puppet/util/rdoc/parser/puppet_parser_rdoc2.rb +1 -1
  283. data/lib/puppet/util/reference.rb +8 -1
  284. data/lib/puppet/util/windows/adsi.rb +18 -15
  285. data/lib/puppet/util/windows/principal.rb +6 -7
  286. data/lib/puppet/util/windows/process.rb +1 -1
  287. data/lib/puppet/util/windows/registry.rb +2 -2
  288. data/lib/puppet/util/windows/sid.rb +7 -62
  289. data/lib/puppet/vendor/deep_merge/README.md +2 -2
  290. data/lib/puppet/vendor/pathspec/lib/pathspec/gitignorespec.rb +18 -18
  291. data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version.rb +2 -2
  292. data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb +5 -5
  293. data/lib/puppet/vendor/semantic_puppet/locales/config.yaml +1 -1
  294. data/lib/puppet/version.rb +1 -1
  295. data/lib/puppet_pal.rb +874 -0
  296. data/locales/ja/puppet.po +140 -163
  297. data/locales/puppet.pot +940 -597
  298. data/man/man5/puppet.conf.5 +16 -91
  299. data/man/man8/puppet-agent.8 +2 -6
  300. data/man/man8/puppet-apply.8 +2 -2
  301. data/man/man8/puppet-ca.8 +1 -1
  302. data/man/man8/puppet-catalog.8 +1 -1
  303. data/man/man8/puppet-cert.8 +1 -1
  304. data/man/man8/puppet-certificate.8 +1 -1
  305. data/man/man8/puppet-certificate_request.8 +1 -1
  306. data/man/man8/puppet-certificate_revocation_list.8 +1 -1
  307. data/man/man8/puppet-config.8 +1 -1
  308. data/man/man8/puppet-describe.8 +1 -1
  309. data/man/man8/puppet-device.8 +11 -33
  310. data/man/man8/puppet-doc.8 +1 -1
  311. data/man/man8/puppet-epp.8 +1 -1
  312. data/man/man8/puppet-facts.8 +1 -1
  313. data/man/man8/puppet-filebucket.8 +4 -22
  314. data/man/man8/puppet-generate.8 +1 -1
  315. data/man/man8/puppet-help.8 +1 -1
  316. data/man/man8/puppet-key.8 +1 -1
  317. data/man/man8/puppet-lookup.8 +1 -1
  318. data/man/man8/puppet-man.8 +1 -1
  319. data/man/man8/puppet-master.8 +1 -1
  320. data/man/man8/puppet-module.8 +2 -11
  321. data/man/man8/puppet-node.8 +1 -1
  322. data/man/man8/puppet-parser.8 +1 -1
  323. data/man/man8/puppet-plugin.8 +1 -1
  324. data/man/man8/puppet-report.8 +1 -1
  325. data/man/man8/puppet-resource.8 +1 -1
  326. data/man/man8/puppet-status.8 +1 -1
  327. data/man/man8/puppet.8 +2 -2
  328. data/spec/integration/application/lookup_spec.rb +0 -21
  329. data/spec/integration/parser/compiler_spec.rb +18 -0
  330. data/spec/integration/parser/script_compiler_spec.rb +113 -0
  331. data/spec/integration/provider/mount_spec.rb +2 -0
  332. data/spec/integration/type/file_spec.rb +11 -3
  333. data/spec/integration/util/windows/adsi_spec.rb +1 -86
  334. data/spec/integration/util/windows/principal_spec.rb +1 -10
  335. data/spec/shared_contexts/checksum.rb +4 -1
  336. data/spec/shared_contexts/digests.rb +46 -1
  337. data/spec/shared_contexts/types_setup.rb +8 -3
  338. data/spec/unit/agent_spec.rb +2 -2
  339. data/spec/unit/application/cert_spec.rb +5 -17
  340. data/spec/unit/application/device_spec.rb +2 -96
  341. data/spec/unit/application/filebucket_spec.rb +18 -4
  342. data/spec/unit/configurer/plugin_handler_spec.rb +5 -32
  343. data/spec/unit/configurer_spec.rb +3 -3
  344. data/spec/unit/datatypes_spec.rb +304 -0
  345. data/spec/unit/defaults_spec.rb +41 -20
  346. data/spec/unit/face/config_spec.rb +46 -1
  347. data/spec/unit/face/epp_face_spec.rb +7 -3
  348. data/spec/unit/face/module/search_spec.rb +11 -0
  349. data/spec/unit/face/parser_spec.rb +2 -2
  350. data/spec/unit/file_bucket/dipper_spec.rb +12 -1
  351. data/spec/unit/forge/module_release_spec.rb +70 -0
  352. data/spec/unit/functions/break_spec.rb +34 -2
  353. data/spec/unit/functions/contain_spec.rb +1 -0
  354. data/spec/unit/functions/convert_to_spec.rb +22 -0
  355. data/spec/unit/functions/epp_spec.rb +5 -0
  356. data/spec/unit/functions/include_spec.rb +15 -0
  357. data/spec/unit/functions/module_directory_spec.rb +43 -0
  358. data/spec/unit/functions/new_spec.rb +14 -14
  359. data/spec/unit/functions/require_spec.rb +2 -0
  360. data/spec/unit/functions/shared.rb +12 -0
  361. data/spec/unit/functions/step_spec.rb +1 -1
  362. data/spec/unit/functions4_spec.rb +49 -4
  363. data/spec/unit/indirector/catalog/compiler_spec.rb +3 -3
  364. data/spec/unit/indirector/file_bucket_file/file_spec.rb +148 -94
  365. data/spec/unit/indirector/node/ldap_spec.rb +15 -12
  366. data/spec/unit/indirector/rest_spec.rb +0 -43
  367. data/spec/unit/interface/action_spec.rb +33 -0
  368. data/spec/unit/module_tool/applications/builder_spec.rb +7 -0
  369. data/spec/unit/module_tool/applications/installer_spec.rb +8 -0
  370. data/spec/unit/module_tool/applications/uninstaller_spec.rb +8 -0
  371. data/spec/unit/module_tool/applications/upgrader_spec.rb +6 -0
  372. data/spec/unit/network/http/connection_spec.rb +1 -1
  373. data/spec/unit/network/http/factory_spec.rb +28 -35
  374. data/spec/unit/parser/compiler_spec.rb +0 -8
  375. data/spec/unit/parser/environment_compiler_spec.rb +36 -0
  376. data/spec/unit/parser/functions/create_resources_spec.rb +9 -0
  377. data/spec/unit/parser/functions/inline_template_spec.rb +7 -0
  378. data/spec/unit/parser/functions/realize_spec.rb +9 -0
  379. data/spec/unit/parser/functions/tag_spec.rb +7 -0
  380. data/spec/unit/parser/functions/tagged_spec.rb +25 -0
  381. data/spec/unit/parser/functions/template_spec.rb +8 -0
  382. data/spec/unit/parser/scope_spec.rb +19 -0
  383. data/spec/unit/pops/evaluator/conditionals_spec.rb +1 -1
  384. data/spec/unit/pops/loaders/loader_spec.rb +516 -0
  385. data/spec/unit/pops/loaders/loaders_spec.rb +11 -0
  386. data/spec/unit/pops/loaders/module_loaders_spec.rb +43 -0
  387. data/spec/unit/pops/loaders/static_loader_spec.rb +15 -7
  388. data/spec/unit/pops/model/model_spec.rb +5 -0
  389. data/spec/unit/pops/parser/lexer2_spec.rb +15 -0
  390. data/spec/unit/pops/parser/locator_spec.rb +20 -0
  391. data/spec/unit/pops/parser/parse_basic_expressions_spec.rb +33 -0
  392. data/spec/unit/pops/parser/parse_calls_spec.rb +28 -0
  393. data/spec/unit/pops/parser/parse_conditionals_spec.rb +12 -0
  394. data/spec/unit/pops/parser/parse_plan_spec.rb +48 -0
  395. data/spec/unit/pops/serialization/packer_spec.rb +8 -0
  396. data/spec/unit/pops/serialization/serialization_spec.rb +30 -0
  397. data/spec/unit/pops/serialization/to_from_hr_spec.rb +31 -0
  398. data/spec/unit/pops/types/error_spec.rb +207 -0
  399. data/spec/unit/pops/types/p_init_type_spec.rb +98 -0
  400. data/spec/unit/pops/types/p_object_type_spec.rb +275 -10
  401. data/spec/unit/pops/types/p_uri_type_spec.rb +191 -0
  402. data/spec/unit/pops/types/ruby_generator_spec.rb +82 -44
  403. data/spec/unit/pops/types/task_spec.rb +353 -0
  404. data/spec/unit/pops/types/type_calculator_spec.rb +76 -5
  405. data/spec/unit/pops/types/type_formatter_spec.rb +31 -13
  406. data/spec/unit/pops/types/type_parser_spec.rb +13 -1
  407. data/spec/unit/pops/types/types_spec.rb +60 -0
  408. data/spec/unit/pops/validator/validator_spec.rb +76 -0
  409. data/spec/unit/provider/group/groupadd_spec.rb +77 -1
  410. data/spec/unit/provider/group/pw_spec.rb +4 -4
  411. data/spec/unit/provider/group/windows_adsi_spec.rb +22 -79
  412. data/spec/unit/provider/mount_spec.rb +18 -5
  413. data/spec/unit/provider/nameservice_spec.rb +5 -5
  414. data/spec/unit/provider/package/dnf_spec.rb +2 -2
  415. data/spec/unit/provider/package/gem_spec.rb +1 -1
  416. data/spec/unit/provider/package/pkg_spec.rb +3 -0
  417. data/spec/unit/provider/package/yum_spec.rb +40 -0
  418. data/spec/unit/provider/service/launchd_spec.rb +2 -1
  419. data/spec/unit/provider/service/redhat_spec.rb +5 -0
  420. data/spec/unit/provider/service/systemd_spec.rb +1 -1
  421. data/spec/unit/provider/user/hpux_spec.rb +2 -2
  422. data/spec/unit/provider/user/openbsd_spec.rb +2 -2
  423. data/spec/unit/provider/user/pw_spec.rb +14 -14
  424. data/spec/unit/provider/user/user_role_add_spec.rb +19 -2
  425. data/spec/unit/provider/user/useradd_spec.rb +188 -22
  426. data/spec/unit/provider/user/windows_adsi_spec.rb +4 -4
  427. data/spec/unit/provider/zfs/zfs_spec.rb +55 -1
  428. data/spec/unit/provider_spec.rb +48 -0
  429. data/spec/unit/puppet_pal_2pec.rb +1005 -0
  430. data/spec/unit/puppet_pal_spec.rb +11 -0
  431. data/spec/unit/settings/ini_file_spec.rb +313 -2
  432. data/spec/unit/ssl/certificate_request_spec.rb +42 -1
  433. data/spec/unit/ssl/certificate_revocation_list_spec.rb +2 -1
  434. data/spec/unit/transaction/report_spec.rb +1 -0
  435. data/spec/unit/transaction_spec.rb +112 -21
  436. data/spec/unit/type/file/checksum_spec.rb +20 -0
  437. data/spec/unit/type/file_spec.rb +8 -0
  438. data/spec/unit/type/group_spec.rb +8 -0
  439. data/spec/unit/type/k5login_spec.rb +22 -1
  440. data/spec/unit/type/scheduled_task_spec.rb +15 -0
  441. data/spec/unit/type/user_spec.rb +11 -1
  442. data/spec/unit/type/yumrepo_spec.rb +5 -0
  443. data/spec/unit/util/checksums_spec.rb +3 -3
  444. data/spec/unit/util/log/destinations_spec.rb +14 -0
  445. data/spec/unit/util/network_device/cisco/device_spec.rb +1 -1
  446. data/spec/unit/util/plist_spec.rb +3 -3
  447. data/spec/unit/util/windows/adsi_spec.rb +27 -31
  448. data/spec/unit/util/windows/sid_spec.rb +15 -86
  449. data/spec/unit/util_spec.rb +17 -3
  450. data/tasks/manpages.rake +1 -1
  451. metadata +220 -182
  452. data/lib/puppet/bindings.rb +0 -148
  453. data/lib/puppet/configurer/downloader_factory.rb +0 -44
  454. data/spec/unit/configurer/downloader_factory_spec.rb +0 -129
@@ -57,7 +57,9 @@ class Puppet::Indirector::REST < Puppet::Indirector::Terminus
57
57
  if setting && setting != :server && Puppet.settings.set_by_config?(setting)
58
58
  Puppet.settings[setting]
59
59
  else
60
- server = Puppet.lookup(:server) do
60
+ begin
61
+ Puppet.lookup(:server)
62
+ rescue
61
63
  if primary_server = Puppet.settings[:server_list][0]
62
64
  Puppet.debug "Dynamically-bound server lookup failed; using first entry"
63
65
  primary_server[0]
@@ -67,7 +69,6 @@ class Puppet::Indirector::REST < Puppet::Indirector::Terminus
67
69
  Puppet.settings[setting]
68
70
  end
69
71
  end
70
- server
71
72
  end
72
73
  end
73
74
 
@@ -83,21 +84,22 @@ class Puppet::Indirector::REST < Puppet::Indirector::Terminus
83
84
  (srv_setting && srv_setting != :server && Puppet.settings.set_by_config?(srv_setting))
84
85
  Puppet.settings[setting].to_i
85
86
  else
86
- port = Puppet.lookup(:serverport) do
87
+ begin
88
+ Puppet.lookup(:serverport).to_i
89
+ rescue
87
90
  if primary_server = Puppet.settings[:server_list][0]
88
91
  Puppet.debug "Dynamically-bound port lookup failed; using first entry"
89
92
 
90
93
  # Port might not be set, so we want to fallback in that
91
94
  # case. We know we don't need to use `setting` here, since
92
95
  # the default value of every port setting is `masterport`
93
- (primary_server[1] || Puppet.settings[:masterport])
96
+ (primary_server[1] || Puppet.settings[:masterport]).to_i
94
97
  else
95
98
  setting ||= :masterport
96
99
  Puppet.debug "Dynamically-bound port lookup failed; falling back to #{setting} setting"
97
- Puppet.settings[setting]
100
+ Puppet.settings[setting].to_i
98
101
  end
99
102
  end
100
- port.to_i
101
103
  end
102
104
  end
103
105
 
@@ -181,7 +183,7 @@ class Puppet::Indirector::REST < Puppet::Indirector::Terminus
181
183
  # While this way of handling the issue is not perfect, there is at least an error
182
184
  # that makes a user aware of the reason for the failure.
183
185
  #
184
- content_type, body = parse_response(response)
186
+ _, body = parse_response(response)
185
187
  msg = _("Find %{uri} resulted in 404 with the message: %{body}") % { uri: elide(uri_with_query_string, 100), body: body }
186
188
  raise Puppet::Error, msg
187
189
  else
@@ -261,9 +263,7 @@ class Puppet::Indirector::REST < Puppet::Indirector::Terminus
261
263
  def handle_response(request, response)
262
264
  server_version = response[Puppet::Network::HTTP::HEADER_PUPPET_VERSION]
263
265
  if server_version
264
- Puppet.lookup(:server_agent_version) do
265
- Puppet.push_context(:server_agent_version => server_version)
266
- end
266
+ Puppet.push_context({:server_agent_version => server_version})
267
267
  if SemanticPuppet::Version.parse(server_version).major < MAJOR_VERSION_JSON_DEFAULT &&
268
268
  Puppet[:preferred_serialization_format] != 'pson'
269
269
  #TRANSLATORS "PSON" should not be translated
@@ -318,8 +318,7 @@ class Puppet::Indirector::REST < Puppet::Indirector::Terminus
318
318
  # uncompress_body)
319
319
  def parse_response(response)
320
320
  if response['content-type']
321
- [ response['content-type'].gsub(/\s*;.*$/,''),
322
- body = uncompress_body(response) ]
321
+ [ response['content-type'].gsub(/\s*;.*$/,''), uncompress_body(response) ]
323
322
  else
324
323
  raise _("No content type in http response; cannot parse")
325
324
  end
@@ -59,7 +59,7 @@ class Puppet::InfoService::ClassInformationService
59
59
  {:classes =>
60
60
  parse_result.definitions.select {|d| d.is_a?(Puppet::Pops::Model::HostClassDefinition)}.map do |d|
61
61
  {:name => d.name,
62
- :params => params = d.parameters.map {|p| extract_param(p) }
62
+ :params => d.parameters.map {|p| extract_param(p) }
63
63
  }
64
64
  end
65
65
  }
@@ -149,6 +149,17 @@ class Puppet::Interface::Action
149
149
  @render_as = value.to_sym
150
150
  end
151
151
 
152
+ # @api private
153
+ # @return [void]
154
+ def deprecate
155
+ @deprecated = true
156
+ end
157
+
158
+ # @api private
159
+ # @return [Boolean]
160
+ def deprecated?
161
+ @deprecated
162
+ end
152
163
 
153
164
  ########################################################################
154
165
  # Initially, this was defined to allow the @action.invoke pattern, which is
@@ -17,6 +17,14 @@ class Puppet::Interface::ActionBuilder
17
17
  new(face, name, &block).action
18
18
  end
19
19
 
20
+ # Deprecates the action
21
+ # @return [void]
22
+ # @api private
23
+ # @dsl Faces
24
+ def deprecate
25
+ @action.deprecate
26
+ end
27
+
20
28
  # Ideally the method we're defining here would be added to the action, and a
21
29
  # method on the face would defer to it, but we can't get scope correct, so
22
30
  # we stick with this. --daniel 2011-03-24
@@ -26,7 +26,7 @@ module Puppet::Interface::OptionManager
26
26
 
27
27
  # @api private
28
28
  def walk_inheritance_tree(start, sym)
29
- result = (start ||= [])
29
+ result = (start || [])
30
30
  if self.is_a?(Class) and superclass.respond_to?(sym)
31
31
  result = superclass.send(sym) + result
32
32
  elsif self.class.respond_to?(sym)
@@ -13,12 +13,14 @@ module Puppet
13
13
  require 'puppet/pops/loader/static_loader'
14
14
  require 'puppet/pops/loader/runtime3_type_loader'
15
15
  require 'puppet/pops/loader/ruby_function_instantiator'
16
+ require 'puppet/pops/loader/ruby_data_type_instantiator'
16
17
  require 'puppet/pops/loader/puppet_function_instantiator'
17
18
  require 'puppet/pops/loader/type_definition_instantiator'
18
19
  require 'puppet/pops/loader/puppet_resource_type_impl_instantiator'
19
20
  require 'puppet/pops/loader/loader_paths'
20
21
  require 'puppet/pops/loader/simple_environment_loader'
21
22
  require 'puppet/pops/loader/predefined_loader'
23
+ require 'puppet/pops/loader/puppet_plan_instantiator'
22
24
  end
23
25
  end
24
26
 
@@ -334,7 +334,7 @@ class Puppet::Module
334
334
  def dependencies_as_modules
335
335
  dependent_modules = []
336
336
  dependencies and dependencies.each do |dep|
337
- author, dep_name = dep["name"].split('/')
337
+ _, dep_name = dep["name"].split('/')
338
338
  found_module = environment.module(dep_name)
339
339
  dependent_modules << found_module if found_module
340
340
  end
@@ -457,7 +457,11 @@ class Puppet::Module
457
457
 
458
458
  def assert_validity
459
459
  if !Puppet::Module.is_module_directory_name?(@name) && !Puppet::Module.is_module_namespaced_name?(@name)
460
- raise InvalidName, "Invalid module name #{@name}; module names must be alphanumeric (plus '-'), not '#{@name}'"
460
+ raise InvalidName, _(<<-ERROR_STRING).chomp % { name: @name }
461
+ Invalid module name '%{name}'; module names must match either:
462
+ An installed module name (ex. modulename) matching the expression /^[a-z][a-z0-9_]*$/ -or-
463
+ A namespaced module name (ex. author-modulename) matching the expression /^[a-zA-Z0-9]+[-][a-z][a-z0-9_]*$/
464
+ ERROR_STRING
461
465
  end
462
466
  end
463
467
  end
@@ -2,6 +2,7 @@ require 'fileutils'
2
2
  require 'json'
3
3
  require 'puppet/file_system'
4
4
  require 'pathspec'
5
+ require 'facter'
5
6
 
6
7
  module Puppet::ModuleTool
7
8
  module Applications
@@ -14,6 +15,9 @@ module Puppet::ModuleTool
14
15
  end
15
16
 
16
17
  def run
18
+ # Disallow anything that invokes md5 to avoid un-friendly termination due to FIPS
19
+ raise _("Module building is prohibited in FIPS mode.") if Facter.value(:fips_enabled)
20
+
17
21
  load_metadata!
18
22
  create_directory
19
23
  copy_contents
@@ -52,6 +52,9 @@ module Puppet::ModuleTool
52
52
  end
53
53
 
54
54
  def run
55
+ # Disallow anything that invokes md5 to avoid un-friendly termination due to FIPS
56
+ raise _("Module install is prohibited in FIPS mode.") if Facter.value(:fips_enabled)
57
+
55
58
  name = @name.tr('/', '-')
56
59
  version = options[:version] || '>= 0.0.0'
57
60
 
@@ -16,6 +16,9 @@ module Puppet::ModuleTool
16
16
  end
17
17
 
18
18
  def run
19
+ # Disallow anything that invokes md5 to avoid un-friendly termination due to FIPS
20
+ raise _("Module uninstall is prohibited in FIPS mode.") if Facter.value(:fips_enabled)
21
+
19
22
  results = {
20
23
  :module_name => @name,
21
24
  :requested_version => @version,
@@ -76,7 +76,7 @@ module Puppet::ModuleTool
76
76
  # @api private
77
77
  def module_name
78
78
  metadata = JSON.parse((root_dir + 'metadata.json').read)
79
- name = metadata['name'][/-(.*)/, 1]
79
+ metadata['name'][/-(.*)/, 1]
80
80
  end
81
81
 
82
82
  # @api private
@@ -27,6 +27,9 @@ module Puppet::ModuleTool
27
27
  end
28
28
 
29
29
  def run
30
+ # Disallow anything that invokes md5 to avoid un-friendly termination due to FIPS
31
+ raise _("Module upgrade is prohibited in FIPS mode.") if Facter.value(:fips_enabled)
32
+
30
33
  name = @name.tr('/', '-')
31
34
  version = options[:version] || '>= 0.0.0'
32
35
 
@@ -60,7 +60,7 @@ module Puppet::ModuleTool
60
60
  name = mod.forge_name.tr('/', '-')
61
61
  begin
62
62
  version = SemanticPuppet::Version.parse(mod.version)
63
- rescue SemanticPuppet::Version::ValidationFailure => e
63
+ rescue SemanticPuppet::Version::ValidationFailure
64
64
  Puppet.warning _("%{module_name} (%{path}) has an invalid version number (%{version}). The version has been set to 0.0.0. If you are the maintainer for this module, please update the metadata.json with a valid Semantic Version (http://semver.org).") % { module_name: mod.name, path: mod.path, version: mod.version }
65
65
  version = SemanticPuppet::Version.parse("0.0.0")
66
66
  end
@@ -200,7 +200,6 @@ module Puppet::ModuleTool
200
200
  #
201
201
  # @param value [Object] The value to be tested
202
202
  def validate_data_provider(value)
203
- err = nil
204
203
  if value.is_a?(String)
205
204
  unless value =~ /^[a-zA-Z][a-zA-Z0-9_]*$/
206
205
  if value =~ /^[a-zA-Z]/
@@ -16,7 +16,7 @@ module Puppet
16
16
  # is provided, then the authstore is considered local and defaults to "true".
17
17
  def allowed?(name, ip)
18
18
  if name or ip
19
- # This is probably unnecessary, and can cause some weirdnesses in
19
+ # This is probably unnecessary, and can cause some weirdness in
20
20
  # cases where we're operating over localhost but don't have a real
21
21
  # IP defined.
22
22
  raise Puppet::DevError, _("Name and IP must be passed to 'allowed?'") unless name and ip
@@ -191,7 +191,7 @@ class Puppet::Network::HTTP::API::IndirectedRoutes
191
191
  begin
192
192
  yield format
193
193
  true
194
- rescue Puppet::Network::FormatHandler::FormatError => e
194
+ rescue Puppet::Network::FormatHandler::FormatError
195
195
  false
196
196
  end
197
197
  end
@@ -5,7 +5,6 @@ require 'puppet/ssl/validator'
5
5
  require 'puppet/network/http'
6
6
  require 'uri'
7
7
  require 'date'
8
- require 'time'
9
8
 
10
9
  module Puppet::Network::HTTP
11
10
 
@@ -210,7 +209,7 @@ module Puppet::Network::HTTP
210
209
  # it by sleeping for the indicated number of seconds. The response is
211
210
  # returned unmodified if no Retry-After header is present.
212
211
  #
213
- # @param response [Net::HTTPResponse] A response recieved from the
212
+ # @param response [Net::HTTPResponse] A response received from the
214
213
  # HTTP client.
215
214
  #
216
215
  # @return [nil] Sleeps and returns nil if the response contained a
@@ -298,14 +297,7 @@ module Puppet::Network::HTTP
298
297
  end
299
298
 
300
299
  def execute_request(connection, request)
301
- start = Time.now
302
300
  connection.request(request)
303
- rescue EOFError => e
304
- elapsed = (Time.now - start).to_f.round(3)
305
- uri = @site.addr + request.path.split('?')[0]
306
- eof = EOFError.new(_('request %{uri} interrupted after %{elapsed} seconds') % {uri: uri, elapsed: elapsed})
307
- eof.set_backtrace(e.backtrace) unless e.backtrace.empty?
308
- raise eof
309
301
  end
310
302
 
311
303
  def with_connection(site, &block)
@@ -12,8 +12,6 @@ require 'puppet/util/http_proxy'
12
12
  class Puppet::Network::HTTP::Factory
13
13
  @@openssl_initialized = false
14
14
 
15
- KEEP_ALIVE_TIMEOUT = 2**31 - 1
16
-
17
15
  def initialize
18
16
  # PUP-1411, make sure that openssl is initialized before we try to connect
19
17
  if ! @@openssl_initialized
@@ -39,7 +37,6 @@ class Puppet::Network::HTTP::Factory
39
37
  http.use_ssl = site.use_ssl?
40
38
  http.read_timeout = Puppet[:http_read_timeout]
41
39
  http.open_timeout = Puppet[:http_connect_timeout]
42
- http.keep_alive_timeout = KEEP_ALIVE_TIMEOUT if http.respond_to?(:keep_alive_timeout=)
43
40
 
44
41
  if Puppet[:sourceaddress]
45
42
  if http.respond_to?(:local_host)
@@ -52,6 +52,7 @@ class Puppet::Network::HTTP::WEBrick
52
52
 
53
53
  # @api private
54
54
  def create_server(address, port)
55
+ address = nil if address == '*'
55
56
  arguments = {:BindAddress => address, :Port => port, :DoNotReverseLookup => true}
56
57
  arguments.merge!(setup_logger)
57
58
  arguments.merge!(setup_ssl)
@@ -34,7 +34,7 @@ class Rights
34
34
 
35
35
  def is_forbidden_and_why?(name, args = {})
36
36
  res = :nomatch
37
- right = @rights.find do |acl|
37
+ @rights.find do |acl|
38
38
  found = false
39
39
  # an acl can return :dunno, which means "I'm not qualified to answer your question,
40
40
  # please ask someone else". This is used when for instance an acl matches, but not for the
@@ -226,4 +226,57 @@ class Puppet::Node
226
226
  Puppet.warning(_("Trusted node data modified for node %{name}") % { name: name }) unless @trusted_data.nil?
227
227
  @trusted_data = data.freeze
228
228
  end
229
+
230
+ # Resurrects and sanitizes trusted information in the node by modifying it and setting
231
+ # the trusted_data in the node from parameters.
232
+ # This modifies the node
233
+ #
234
+ def sanitize
235
+ # Resurrect "trusted information" that comes from node/fact terminus.
236
+ # The current way this is done in puppet db (currently the only one)
237
+ # is to store the node parameter 'trusted' as a hash of the trusted information.
238
+ #
239
+ # Thus here there are two main cases:
240
+ # 1. This terminus was used in a real agent call (only meaningful if someone curls the request as it would
241
+ # fail since the result is a hash of two catalogs).
242
+ # 2 It is a command line call with a given node that use a terminus that:
243
+ # 2.1 does not include a 'trusted' fact - use local from node trusted information
244
+ # 2.2 has a 'trusted' fact - this in turn could be
245
+ # 2.2.1 puppet db having stored trusted node data as a fact (not a great design)
246
+ # 2.2.2 some other terminus having stored a fact called "trusted" (most likely that would have failed earlier, but could
247
+ # be spoofed).
248
+ #
249
+ # For the reasons above, the resurrection of trusted node data with authenticated => true is only performed
250
+ # if user is running as root, else it is resurrected as unauthenticated.
251
+ #
252
+ trusted_param = @parameters['trusted']
253
+ if trusted_param
254
+ # Blows up if it is a parameter as it will be set as $trusted by the compiler as if it was a variable
255
+ @parameters.delete('trusted')
256
+ unless trusted_param.is_a?(Hash) && %w{authenticated certname extensions}.all? {|key| trusted_param.has_key?(key) }
257
+ # trusted is some kind of garbage, do not resurrect
258
+ trusted_param = nil
259
+ end
260
+ else
261
+ # trusted may be Boolean false if set as a fact by someone
262
+ trusted_param = nil
263
+ end
264
+
265
+ # The options for node.trusted_data in priority order are:
266
+ # 1) node came with trusted_data so use that
267
+ # 2) else if there is :trusted_information in the puppet context
268
+ # 3) else if the node provided a 'trusted' parameter (parsed out above)
269
+ # 4) last, fallback to local node trusted information
270
+ #
271
+ # Note that trusted_data should be a hash, but (2) and (4) are not
272
+ # hashes, so we to_h at the end
273
+ if !trusted_data
274
+ trusted = Puppet.lookup(:trusted_information) do
275
+ trusted_param || Puppet::Context::TrustedInformation.local(self)
276
+ end
277
+
278
+ # Ruby 1.9.3 can't apply to_h to a hash, so check first
279
+ self.trusted_data = (trusted.is_a?(Hash) ? trusted : trusted.to_h)
280
+ end
281
+ end
229
282
  end
@@ -295,7 +295,7 @@ class Puppet::Node::Environment
295
295
  # @param forge_name [String] The module name
296
296
  # @return [Puppet::Module, nil] The module if found, else nil
297
297
  def module_by_forge_name(forge_name)
298
- author, modname = forge_name.split('/')
298
+ _, modname = forge_name.split('/')
299
299
  found_mod = self.module(modname)
300
300
  found_mod and found_mod.forge_name == forge_name ?
301
301
  found_mod :
@@ -1,7 +1,7 @@
1
1
  require 'puppet/coercion'
2
2
 
3
3
  # This specialized {Puppet::Parameter} handles Boolean options, accepting lots
4
- # of strings and symbols for both truthiness and falsehood.
4
+ # of strings and symbols for both truth and falsehood.
5
5
  #
6
6
  class Puppet::Parameter::Boolean < Puppet::Parameter
7
7
  def unsafe_munge(value)
@@ -2,6 +2,7 @@
2
2
  module Puppet::Parser; end
3
3
 
4
4
  require 'puppet/parser/ast'
5
+ require 'puppet/parser/abstract_compiler'
5
6
  require 'puppet/parser/compiler'
6
7
  require 'puppet/parser/compiler/catalog_validator'
7
8
  require 'puppet/resource/type_collection'
@@ -0,0 +1,36 @@
1
+
2
+ module Puppet::Parser::AbstractCompiler
3
+
4
+ # Returns the catalog for a compilation. Must return a Puppet::Resource::Catalog or fail with an
5
+ # error if the specific compiler does not support catalog operations.
6
+ #
7
+ def catalog
8
+ raise Puppet::DevError("Class '#{self.class}' should have implemented 'catalog'")
9
+ end
10
+
11
+ # Returns the environment for the compilation
12
+ #
13
+ def environment
14
+ raise Puppet::DevError("Class '#{self.class}' should have implemented 'environment'")
15
+ end
16
+
17
+ # Produces a new scope
18
+ # This method is here if there are functions/logic that will call this for some other purpose than to create
19
+ # a named scope for a class. It may not have to be here. (TODO)
20
+ #
21
+ def newscope(scope, options)
22
+ raise Puppet::DevError("Class '#{self.class}' should have implemented 'newscope'")
23
+ end
24
+
25
+ # Returns a hash of all externally referenceable qualified variables
26
+ #
27
+ def qualified_variables
28
+ raise Puppet::DevError("Class '#{self.class}' should have implemented 'qualified_variables'")
29
+ end
30
+
31
+ # Returns the top scope instance
32
+ def topscope
33
+ raise Puppet::DevError("Class '#{self.class}' should have implemented 'topscope'")
34
+ end
35
+
36
+ end