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
@@ -5,7 +5,7 @@ Puppet::Type.type(:zfs).provide(:zfs) do
5
5
 
6
6
  def self.instances
7
7
  zfs(:list, '-H').split("\n").collect do |line|
8
- name,used,avail,refer,mountpoint = line.split(/\s+/)
8
+ name, _used, _avail, _refer, _mountpoint = line.split(/\s+/)
9
9
  new({:name => name, :ensure => :present})
10
10
  end
11
11
  end
@@ -42,13 +42,24 @@ Puppet::Type.type(:zfs).provide(:zfs) do
42
42
  end
43
43
  end
44
44
 
45
+ # On FreeBSD zoned is called jailed
46
+ def container_property
47
+ case Facter.value(:operatingsystem)
48
+ when "FreeBSD"
49
+ :jailed
50
+ else
51
+ :zoned
52
+ end
53
+ end
54
+
45
55
  PARAMETER_UNSET_OR_NOT_AVAILABLE = '-'
46
56
 
47
57
  # https://docs.oracle.com/cd/E19963-01/html/821-1448/gbscy.html
48
58
  # shareiscsi (added in build 120) was removed from S11 build 136
49
59
  # aclmode was removed from S11 in build 139 but it may have been added back
60
+ # acltype is for ZFS on Linux, and allows disabling or enabling POSIX ACLs
50
61
  # http://webcache.googleusercontent.com/search?q=cache:-p74K0DVsdwJ:developers.slashdot.org/story/11/11/09/2343258/solaris-11-released+&cd=13
51
- [:aclmode, :shareiscsi].each do |field|
62
+ [:aclmode, :acltype, :shareiscsi].each do |field|
52
63
  # The zfs commands use the property value '-' to indicate that the
53
64
  # property is not set. We make use of this value to indicate that the
54
65
  # property is not set since it is not available. Conversely, if these
@@ -74,7 +85,7 @@ Puppet::Type.type(:zfs).provide(:zfs) do
74
85
  :mountpoint, :nbmand, :primarycache, :quota, :readonly,
75
86
  :recordsize, :refquota, :refreservation, :reservation,
76
87
  :secondarycache, :setuid, :sharenfs, :sharesmb,
77
- :snapdir, :version, :volsize, :vscan, :xattr, :zoned].each do |field|
88
+ :snapdir, :version, :volsize, :vscan, :xattr].each do |field|
78
89
  define_method(field) do
79
90
  zfs(:get, "-H", "-o", "value", field, @resource[:name]).strip
80
91
  end
@@ -84,5 +95,14 @@ Puppet::Type.type(:zfs).provide(:zfs) do
84
95
  end
85
96
  end
86
97
 
98
+
99
+ define_method(:zoned) do
100
+ zfs(:get, "-H", "-o", "value", container_property, @resource[:name]).strip
101
+ end
102
+
103
+ define_method("zoned=") do |should|
104
+ zfs(:set, "#{container_property}=#{should}", @resource[:name])
105
+ end
106
+
87
107
  end
88
108
 
@@ -6,7 +6,7 @@ Puppet::Type.type(:zpool).provide(:zpool) do
6
6
  #NAME SIZE ALLOC FREE CAP HEALTH ALTROOT
7
7
  def self.instances
8
8
  zpool(:list, '-H').split("\n").collect do |line|
9
- name, size, alloc, free, cap, health, altroot = line.split(/\s+/)
9
+ name, _size, _alloc, _free, _cap, _health, _altroot = line.split(/\s+/)
10
10
  new({:name => name, :ensure => :present})
11
11
  end
12
12
  end
@@ -34,8 +34,6 @@ config = Puppet::Util::Reference.newreference(:configuration, :depth => 1, :doc
34
34
  val = 'Unix/Linux: /var/log/puppetlabs/puppet -- Windows: C:\ProgramData\PuppetLabs\puppet\var\log -- Non-root user: ~/.puppetlabs/var/log'
35
35
  elsif name.to_s == 'hiera_config'
36
36
  val = '$confdir/hiera.yaml. However, if a file exists at $codedir/hiera.yaml, Puppet uses that instead.'
37
- elsif name.to_s == 'certname'
38
- val = "the Host's fully qualified domain name, as determined by facter"
39
37
  end
40
38
 
41
39
  # Leave out the section information; it was apparently confusing people.
@@ -79,7 +79,6 @@ Puppet::Util::Reference.newreference :type, :doc => "All Puppet resource types a
79
79
 
80
80
  raise _("Could not retrieve property %{sname} on type %{type_name}") % { sname: sname, type_name: type.name } unless property
81
81
 
82
- doc = nil
83
82
  unless doc = property.doc
84
83
  $stderr.puts _("No docs for %{type}[%{sname}]") % { type: type, sname: sname }
85
84
  next
@@ -257,7 +257,6 @@ class Puppet::Resource
257
257
  { type: (type[:type] || type["type"]).inspect, title: (type[:title] || type["title"]).inspect }
258
258
  end
259
259
 
260
- environment = attributes[:environment]
261
260
  # In order to avoid an expensive search of 'known_resource_types" and
262
261
  # to obey/preserve the implementation of the resource's type - if the
263
262
  # given type is a resource type implementation (one of):
@@ -279,7 +278,7 @@ class Puppet::Resource
279
278
  end
280
279
  @exported = false
281
280
 
282
- # Set things like strictness first.
281
+ # Set things like environment, strictness first.
283
282
  attributes.each do |attr, value|
284
283
  next if attr == :parameters
285
284
  send(attr.to_s + "=", value)
@@ -595,7 +595,7 @@ class Puppet::Resource::Catalog < Puppet::Graph::SimpleGraph
595
595
  transaction = Puppet::Transaction.new(self, options[:report], prioritizer)
596
596
  transaction.tags = options[:tags] if options[:tags]
597
597
  transaction.ignoreschedules = true if options[:ignoreschedules]
598
- transaction.for_network_device = Puppet.lookup(:network_device) { nil } || options[:network_device]
598
+ transaction.for_network_device = options[:network_device]
599
599
 
600
600
  transaction
601
601
  end
@@ -144,7 +144,6 @@ module Puppet
144
144
  # Puppet::Transaction::Event failure with the given message.
145
145
  # @param message [String] the reason for a status failure
146
146
  def fail_with_event(message)
147
- failed = true
148
147
  add_event(@real_resource.event(:name => :resource_error, :status => "failure", :message => message))
149
148
  end
150
149
 
@@ -43,7 +43,7 @@ class Puppet::Resource::Type
43
43
  # :capability - the type name of the capres produced/consumed
44
44
  # :mappings - a hash of attribute_name => Expression
45
45
  # These two attributes are populated in
46
- # PopsBridge::instantiate_CapabilityMaping
46
+ # PopsBridge::instantiate_CapabilityMapping
47
47
 
48
48
  # Map from argument (aka parameter) names to Puppet Type
49
49
  # @return [Hash<Symbol, Puppet::Pops::Types::PAnyType] map from name to type
@@ -442,9 +442,9 @@ class Puppet::Resource::Type
442
442
  def convert_from_ast(name)
443
443
  value = name.value
444
444
  if value.is_a?(Puppet::Parser::AST::Regex)
445
- name = value.value
445
+ value.value
446
446
  else
447
- name = value
447
+ value
448
448
  end
449
449
  end
450
450
 
@@ -476,7 +476,7 @@ class Puppet::Resource::Type
476
476
  # Note we're doing something somewhat weird here -- we're setting
477
477
  # the class's namespace to its fully qualified name. This means
478
478
  # anything inside that class starts looking in that namespace first.
479
- @namespace, ignored_shortname = @type == :hostclass ? [@name, ''] : namesplit(@name)
479
+ @namespace, _ = @type == :hostclass ? [@name, ''] : namesplit(@name)
480
480
  end
481
481
  end
482
482
 
@@ -58,7 +58,7 @@ class Puppet::Resource::TypeCollection
58
58
 
59
59
  def add(instance)
60
60
  # return a merged instance, or the given
61
- result = catch(:merged) {
61
+ catch(:merged) {
62
62
  send("add_#{instance.type}", instance)
63
63
  instance.resource_type_collection = self
64
64
  instance
@@ -98,7 +98,7 @@ class Puppet::Settings::BaseSetting
98
98
  @iscreated
99
99
  end
100
100
 
101
- # short name for the celement
101
+ # short name for the element
102
102
  def short=(value)
103
103
  raise ArgumentError, _("Short names can only be one character.") if value.to_s.length != 1
104
104
  @short = value.to_s
@@ -22,7 +22,6 @@ class Puppet::Settings::EnvironmentConf
22
22
  def self.load_from(path_to_env, global_module_path)
23
23
  path_to_env = File.expand_path(path_to_env)
24
24
  conf_file = File.join(path_to_env, 'environment.conf')
25
- config = nil
26
25
 
27
26
  begin
28
27
  config = Puppet.settings.parse_file(conf_file)
@@ -12,7 +12,7 @@ class Puppet::Settings::IniFile
12
12
  def self.parse(config_fh)
13
13
  config = new([DefaultSection.new])
14
14
  config_fh.each_line do |line|
15
- case line
15
+ case line.chomp
16
16
  when /^(\s*)\[([[:word:]]+)\](\s*)$/
17
17
  config.append(SectionLine.new($1, $2, $3))
18
18
  when /^(\s*)([[:word:]]+)(\s*=\s*)(.*?)(\s*)$/
@@ -34,6 +34,15 @@ class Puppet::Settings::IniFile
34
34
  @lines << line
35
35
  end
36
36
 
37
+ def delete(section, name)
38
+ delete_offset = @lines.index(setting(section, name))
39
+ next_offset = delete_offset + 1
40
+ if next_offset < @lines.length
41
+ @lines[next_offset].previous = @lines[delete_offset].previous
42
+ end
43
+ @lines.delete_at(delete_offset)
44
+ end
45
+
37
46
  def insert_after(line, new_line)
38
47
  new_line.previous = line
39
48
 
@@ -76,7 +85,30 @@ class Puppet::Settings::IniFile
76
85
  lines.select { |line| line.is_a?(SettingLine) }
77
86
  end
78
87
 
88
+ def settings_exist_in_default_section?
89
+ lines_in(DEFAULT_SECTION_NAME).any? { |line| line.is_a?(SettingLine) }
90
+ end
91
+
92
+ def section_exists_with_default_section_name?
93
+ section_lines.any? do |section|
94
+ !section.is_a?(DefaultSection) && section.name == DEFAULT_SECTION_NAME
95
+ end
96
+ end
97
+
98
+ def set_default_section_write_sectionline(value)
99
+ if index = @lines.find_index { |line| line.is_a?(DefaultSection) }
100
+ @lines[index].write_sectionline = true
101
+ end
102
+ end
103
+
79
104
  def write(fh)
105
+ # If no real section line for the default section exists, configure the
106
+ # DefaultSection object to write its section line. (DefaultSection objects
107
+ # don't write the section line unless explicitly configured to do so)
108
+ if settings_exist_in_default_section? && !section_exists_with_default_section_name?
109
+ set_default_section_write_sectionline(true)
110
+ end
111
+
80
112
  fh.truncate(0)
81
113
  fh.rewind
82
114
  @lines.each do |line|
@@ -99,6 +131,14 @@ class Puppet::Settings::IniFile
99
131
  end
100
132
  end
101
133
 
134
+ def delete(section_name, name)
135
+ setting = @config.setting(section_name, name)
136
+ if setting
137
+ @config.delete(section_name, name)
138
+ setting.to_s.chomp
139
+ end
140
+ end
141
+
102
142
  private
103
143
 
104
144
  def add_setting(section_name, name, value)
@@ -131,41 +171,55 @@ class Puppet::Settings::IniFile
131
171
  Line = Struct.new(:text) do
132
172
  include LineNumber
133
173
 
174
+ def to_s
175
+ text
176
+ end
177
+
134
178
  def write(fh)
135
- fh.puts(text)
179
+ fh.puts(to_s)
136
180
  end
137
181
  end
138
182
 
139
183
  SettingLine = Struct.new(:prefix, :name, :infix, :value, :suffix) do
140
184
  include LineNumber
141
185
 
186
+ def to_s
187
+ "#{prefix}#{name}#{infix}#{value}#{suffix}"
188
+ end
189
+
142
190
  def write(fh)
143
- fh.write(prefix)
144
- fh.write(name)
145
- fh.write(infix)
146
- fh.write(value)
147
- fh.puts(suffix)
191
+ fh.puts(to_s)
192
+ end
193
+
194
+ def ==(other)
195
+ super(other) && self.line_number == other.line_number
148
196
  end
149
197
  end
150
198
 
151
199
  SectionLine = Struct.new(:prefix, :name, :suffix) do
152
200
  include LineNumber
153
201
 
202
+ def to_s
203
+ "#{prefix}[#{name}]#{suffix}"
204
+ end
205
+
154
206
  def write(fh)
155
- fh.write(prefix)
156
- fh.write("[")
157
- fh.write(name)
158
- fh.write("]")
159
- fh.puts(suffix)
207
+ fh.puts(to_s)
160
208
  end
161
209
  end
162
210
 
163
211
  class DefaultSection < SectionLine
212
+ attr_accessor :write_sectionline
213
+
164
214
  def initialize
215
+ @write_sectionline = false
165
216
  super("", DEFAULT_SECTION_NAME, "")
166
217
  end
167
218
 
168
219
  def write(fh)
220
+ if @write_sectionline
221
+ super(fh)
222
+ end
169
223
  end
170
224
  end
171
225
  end
@@ -399,7 +399,7 @@ class Puppet::SSL::CertificateAuthority
399
399
 
400
400
  # Check for wildcards in the subjectAltName fields too.
401
401
  if csr.subject_alt_names.any? {|x| x.include? '*' }
402
- raise CertificateSigningError.new(hostname), _("CSR '%{csr}' subjectAltName contains a wildcard, which is not allowed: %{alt_names} To continue, this CSR needs to be cleaned.") % { csr: csr.name, alt_names: csr.subject_alt_names.join(', ') }
402
+ raise CertificateSigningError.new(hostname), _("CSR '%{csr}' subjectAltName contains a wildcard, which is not allowed: %{alt_names}. To continue, this CSR needs to be cleaned.") % { csr: csr.name, alt_names: csr.subject_alt_names.join(', ') }
403
403
  end
404
404
  end
405
405
 
@@ -109,7 +109,7 @@ DOC
109
109
 
110
110
  def ext_value_to_ruby_value(asn1_arr)
111
111
  # A list of ASN1 types than can't be directly converted to a Ruby type
112
- @non_convertable ||= [OpenSSL::ASN1::EndOfContent,
112
+ @non_convertible ||= [OpenSSL::ASN1::EndOfContent,
113
113
  OpenSSL::ASN1::BitString,
114
114
  OpenSSL::ASN1::Null,
115
115
  OpenSSL::ASN1::Enumerated,
@@ -130,7 +130,7 @@ DOC
130
130
  # type, use the original ASN1 value. This is needed to work around a bug
131
131
  # in Ruby's OpenSSL library which doesn't convert the value of unknown
132
132
  # extension OIDs properly. See PUP-3560
133
- if @non_convertable.include?(asn1_val.class) then
133
+ if @non_convertible.include?(asn1_val.class) then
134
134
  # Allows OpenSSL to take the ASN1 value and turn it into something Ruby understands
135
135
  OpenSSL::X509::Extension.new(asn1_arr.first.value, asn1_val.to_der).value
136
136
  else
@@ -1,5 +1,6 @@
1
1
  require 'puppet/ssl/base'
2
2
  require 'puppet/indirector'
3
+ require 'puppet/ssl/certificate_signer'
3
4
 
4
5
  # Manage the CRL.
5
6
  class Puppet::SSL::CertificateRevocationList < Puppet::SSL::Base
@@ -105,6 +106,6 @@ private
105
106
  end
106
107
 
107
108
  def sign_with(cakey)
108
- @content.sign(cakey, OpenSSL::Digest::SHA1.new)
109
+ Puppet::SSL::CertificateSigner.new.sign(@content, cakey)
109
110
  end
110
111
  end
@@ -4,11 +4,22 @@
4
4
  #
5
5
  # @api private
6
6
  class Puppet::SSL::CertificateSigner
7
+
8
+ # @!attribute [r] digest
9
+ # @return [OpenSSL::Digest]
10
+ attr_reader :digest
11
+
7
12
  def initialize
8
13
  if OpenSSL::Digest.const_defined?('SHA256')
9
14
  @digest = OpenSSL::Digest::SHA256
10
15
  elsif OpenSSL::Digest.const_defined?('SHA1')
11
16
  @digest = OpenSSL::Digest::SHA1
17
+ elsif OpenSSL::Digest.const_defined?('SHA512')
18
+ @digest = OpenSSL::Digest::SHA512
19
+ elsif OpenSSL::Digest.const_defined?('SHA384')
20
+ @digest = OpenSSL::Digest::SHA384
21
+ elsif OpenSSL::Digest.const_defined?('SHA224')
22
+ @digest = OpenSSL::Digest::SHA224
12
23
  else
13
24
  raise Puppet::Error,
14
25
  "No FIPS 140-2 compliant digest algorithm in OpenSSL::Digest"
@@ -211,7 +211,7 @@ DOC
211
211
  raise Puppet::Error, _("No private key with which to validate certificate with fingerprint: %{fingerprint}") % { fingerprint: certificate.fingerprint } unless key
212
212
  unless certificate.content.check_private_key(key.content)
213
213
  raise Puppet::Error, _(<<ERROR_STRING) % { fingerprint: certificate.fingerprint, cert_name: Puppet[:certname], ssl_dir: Puppet[:ssldir], cert_dir: Puppet[:certdir].gsub('/', '\\') }
214
- The certificate retrieved from the master does not match the agent's private key.
214
+ The certificate retrieved from the master does not match the agent's private key. Did you forget to run as root?
215
215
  Certificate fingerprint: %{fingerprint}
216
216
  To fix this, remove the certificate from both the master and the agent and then start a puppet run, which will automatically regenerate a certificate.
217
217
  On the master:
@@ -320,7 +320,7 @@ ERROR_STRING
320
320
  # configurable
321
321
  # --jeffweiss 29 aug 2012
322
322
  def suitable_message_digest_algorithms
323
- [:SHA1, :SHA256, :SHA512]
323
+ [:SHA1, :SHA224, :SHA256, :SHA384, :SHA512]
324
324
  end
325
325
 
326
326
  # Attempt to retrieve a cert, if we don't already have one.
@@ -23,7 +23,7 @@ class Puppet::SyntaxCheckers::Base64 < Puppet::Plugins::SyntaxCheckers::SyntaxCh
23
23
  # Do a strict decode64 on text with all whitespace stripped since the non strict version
24
24
  # simply skips all non base64 characters
25
25
  Base64.strict_decode64(cleaned_text)
26
- rescue => e
26
+ rescue
27
27
  msg = if (cleaned_text.bytes.to_a.size * 8) % 6 != 0
28
28
  _("Base64 syntax checker: Cannot parse invalid Base64 string - padding is not correct")
29
29
  else
@@ -28,7 +28,7 @@ class Puppet::Transaction
28
28
  # Handles most of the actual interacting with resources
29
29
  attr_reader :resource_harness
30
30
 
31
- attr_reader :prefetched_providers
31
+ attr_reader :prefetched_providers, :prefetch_failed_providers
32
32
 
33
33
  # @!attribute [r] persistence
34
34
  # @return [Puppet::Transaction::Persistence] persistence object for cross
@@ -54,6 +54,8 @@ class Puppet::Transaction
54
54
  @resource_harness = Puppet::Transaction::ResourceHarness.new(self)
55
55
 
56
56
  @prefetched_providers = Hash.new { |h,k| h[k] = {} }
57
+
58
+ @prefetch_failed_providers = Hash.new { |h,k| h[k] = {} }
57
59
  end
58
60
 
59
61
  # Invoke the pre_run_check hook in every resource in the catalog.
@@ -175,9 +177,9 @@ class Puppet::Transaction
175
177
  if resource.is_a?(Puppet::Type::Component)
176
178
  Puppet.warning _("Somehow left a component in the relationship graph")
177
179
  else
178
- resource.info _("Starting to evaluate the resource") if Puppet[:evaltrace] and @catalog.host_config?
180
+ resource.info _("Starting to evaluate the resource") if Puppet[:evaltrace] && @catalog.host_config?
179
181
  seconds = thinmark { block.call(resource) }
180
- resource.info _("Evaluated in %{seconds} seconds") % { seconds: "%0.2f" % seconds } if Puppet[:evaltrace] and @catalog.host_config?
182
+ resource.info _("Evaluated in %{seconds} seconds") % { seconds: "%0.2f" % seconds } if Puppet[:evaltrace] && @catalog.host_config?
181
183
  end
182
184
  end
183
185
 
@@ -231,7 +233,11 @@ class Puppet::Transaction
231
233
 
232
234
  def prefetch_if_necessary(resource)
233
235
  provider_class = resource.provider.class
234
- return unless provider_class.respond_to?(:prefetch) and !prefetched_providers[resource.type][provider_class.name]
236
+ if !provider_class.respond_to?(:prefetch) or
237
+ prefetched_providers[resource.type][provider_class.name] or
238
+ prefetch_failed_providers[resource.type][provider_class.name]
239
+ return
240
+ end
235
241
 
236
242
  resources = resources_by_provider(resource.type, provider_class.name)
237
243
 
@@ -302,14 +308,20 @@ class Puppet::Transaction
302
308
  # up-front at failure time because the graph may be mutated as we
303
309
  # walk it.
304
310
  def propagate_failure(resource)
311
+
312
+ provider_class = resource.provider.class
313
+ s = resource_status(resource)
314
+ if prefetch_failed_providers[resource.type][provider_class.name] && !s.nil?
315
+ message = _("Prefetch failed for %{type_name} provider '%{name}'") % { type_name: resource.type, name: provider_class.name }
316
+ s.fail_with_event(message)
317
+ end
318
+
305
319
  failed = Set.new
306
320
  relationship_graph.direct_dependencies_of(resource).each do |dep|
307
- if (s = resource_status(dep))
308
- failed.merge(s.failed_dependencies) if s.dependency_failed?
309
- if s.failed? || s.failed_to_restart?
310
- failed.add(dep)
311
- end
312
- end
321
+ s = resource_status(dep)
322
+ next if s.nil?
323
+ failed.merge(s.failed_dependencies) if s.dependency_failed?
324
+ failed.add(dep) if s.failed? || s.failed_to_restart?
313
325
  end
314
326
  resource_status(resource).failed_dependencies = failed.to_a
315
327
  end
@@ -338,13 +350,20 @@ class Puppet::Transaction
338
350
  # types, just providers.
339
351
  def prefetch(provider_class, resources)
340
352
  type_name = provider_class.resource_type.name
341
- return if @prefetched_providers[type_name][provider_class.name]
353
+ return if @prefetched_providers[type_name][provider_class.name] ||
354
+ @prefetch_failed_providers[type_name][provider_class.name]
342
355
  Puppet.debug "Prefetching #{provider_class.name} resources for #{type_name}"
343
356
  begin
344
357
  provider_class.prefetch(resources)
345
- rescue LoadError, Puppet::MissingCommand => detail
358
+ rescue Exception => detail
359
+ if !detail.is_a?(LoadError) && !detail.is_a?(Puppet::MissingCommand)
360
+ raise unless Puppet.settings[:future_features]
361
+
362
+ @prefetch_failed_providers[type_name][provider_class.name] = true
363
+ end
346
364
  #TRANSLATORS `prefetch` is a function name and should not be translated
347
- Puppet.log_exception(detail, _("Could not prefetch %{type_name} provider '%{name}': %{detail}") % { type_name: type_name, name: provider_class.name, detail: detail })
365
+ message = _("Could not prefetch %{type_name} provider '%{name}': %{detail}") % { type_name: type_name, name: provider_class.name, detail: detail }
366
+ Puppet.log_exception(detail, message)
348
367
  end
349
368
  @prefetched_providers[type_name][provider_class.name] = true
350
369
  end
@@ -355,7 +374,7 @@ class Puppet::Transaction
355
374
 
356
375
  # Is the resource currently scheduled?
357
376
  def scheduled?(resource)
358
- self.ignoreschedules or resource_harness.scheduled?(resource)
377
+ self.ignoreschedules || resource_harness.scheduled?(resource)
359
378
  end
360
379
 
361
380
  # Should this resource be skipped?
@@ -374,6 +393,10 @@ class Puppet::Transaction
374
393
  unless resource.class == Puppet::Type.type(:whit) then
375
394
  resource.warning _("Skipping because of failed dependencies")
376
395
  end
396
+ elsif resource_status(resource).failed? &&
397
+ @prefetch_failed_providers[resource.type][resource.provider.class.name]
398
+ #Do not try to evaluate a resource with a known failed provider
399
+ resource.warning _("Skipping because provider prefetch failed")
377
400
  elsif resource.virtual?
378
401
  resource.debug "Skipping because virtual"
379
402
  elsif !host_and_device_resource?(resource) && resource.appliable_to_host? && for_network_device