puppet 5.5.16-universal-darwin → 5.5.21-universal-darwin

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 (359) hide show
  1. checksums.yaml +4 -4
  2. data/CODEOWNERS +10 -10
  3. data/Gemfile +2 -3
  4. data/Gemfile.lock +57 -52
  5. data/ext/build_defaults.yaml +1 -0
  6. data/ext/cert_inspector +3 -3
  7. data/ext/project_data.yaml +2 -2
  8. data/ext/puppet-test +2 -2
  9. data/ext/regexp_nodes/regexp_nodes.rb +4 -4
  10. data/ext/windows/service/daemon.rb +54 -8
  11. data/install.rb +6 -24
  12. data/lib/puppet.rb +5 -2
  13. data/lib/puppet/agent.rb +5 -13
  14. data/lib/puppet/application.rb +1 -1
  15. data/lib/puppet/application/agent.rb +15 -1
  16. data/lib/puppet/application/apply.rb +2 -2
  17. data/lib/puppet/application/describe.rb +3 -9
  18. data/lib/puppet/application/device.rb +4 -4
  19. data/lib/puppet/application/doc.rb +1 -1
  20. data/lib/puppet/application/filebucket.rb +13 -0
  21. data/lib/puppet/application/lookup.rb +1 -1
  22. data/lib/puppet/application/resource.rb +4 -4
  23. data/lib/puppet/application/script.rb +2 -2
  24. data/lib/puppet/configurer.rb +86 -28
  25. data/lib/puppet/configurer/downloader.rb +2 -6
  26. data/lib/puppet/daemon.rb +1 -1
  27. data/lib/puppet/defaults.rb +82 -38
  28. data/lib/puppet/error.rb +9 -1
  29. data/lib/puppet/external/nagios/base.rb +1 -1
  30. data/lib/puppet/face/ca.rb +1 -1
  31. data/lib/puppet/face/config.rb +10 -48
  32. data/lib/puppet/face/facts.rb +1 -1
  33. data/lib/puppet/face/module/list.rb +5 -5
  34. data/lib/puppet/face/module/search.rb +1 -1
  35. data/lib/puppet/face/module/uninstall.rb +1 -1
  36. data/lib/puppet/face/module/upgrade.rb +1 -1
  37. data/lib/puppet/face/plugin.rb +9 -2
  38. data/lib/puppet/file_serving/http_metadata.rb +1 -1
  39. data/lib/puppet/file_system.rb +0 -8
  40. data/lib/puppet/file_system/memory_file.rb +1 -1
  41. data/lib/puppet/file_system/posix.rb +3 -2
  42. data/lib/puppet/file_system/uniquefile.rb +4 -0
  43. data/lib/puppet/forge.rb +3 -3
  44. data/lib/puppet/functions/epp.rb +4 -4
  45. data/lib/puppet/functions/inline_epp.rb +5 -5
  46. data/lib/puppet/functions/reduce.rb +2 -4
  47. data/lib/puppet/gettext/module_translations.rb +1 -1
  48. data/lib/puppet/graph/rb_tree_map.rb +2 -2
  49. data/lib/puppet/graph/simple_graph.rb +6 -5
  50. data/lib/puppet/indirector/catalog/compiler.rb +8 -0
  51. data/lib/puppet/indirector/file_bucket_file/file.rb +1 -1
  52. data/lib/puppet/indirector/hiera.rb +2 -0
  53. data/lib/puppet/indirector/resource/ral.rb +1 -3
  54. data/lib/puppet/indirector/resource/validator.rb +1 -1
  55. data/lib/puppet/interface.rb +2 -1
  56. data/lib/puppet/loaders.rb +0 -1
  57. data/lib/puppet/metatype/manager.rb +1 -1
  58. data/lib/puppet/module.rb +1 -1
  59. data/lib/puppet/module_tool/applications/builder.rb +1 -1
  60. data/lib/puppet/module_tool/applications/installer.rb +1 -1
  61. data/lib/puppet/module_tool/applications/uninstaller.rb +3 -3
  62. data/lib/puppet/module_tool/metadata.rb +1 -1
  63. data/lib/puppet/module_tool/shared_behaviors.rb +4 -4
  64. data/lib/puppet/module_tool/tar/mini.rb +12 -2
  65. data/lib/puppet/network/http/api/indirected_routes.rb +13 -12
  66. data/lib/puppet/network/http/api/master/v3/environment.rb +3 -0
  67. data/lib/puppet/network/http/connection.rb +14 -12
  68. data/lib/puppet/network/http/factory.rb +1 -11
  69. data/lib/puppet/network/http/pool.rb +7 -1
  70. data/lib/puppet/network/http/rack/rest.rb +2 -2
  71. data/lib/puppet/network/http/site.rb +1 -1
  72. data/lib/puppet/network/resolver.rb +2 -2
  73. data/lib/puppet/node/environment.rb +4 -2
  74. data/lib/puppet/parameter.rb +8 -0
  75. data/lib/puppet/parser/ast.rb +1 -1
  76. data/lib/puppet/parser/ast/resourceparam.rb +1 -1
  77. data/lib/puppet/parser/compiler/catalog_validator/env_relationship_validator.rb +2 -0
  78. data/lib/puppet/parser/compiler/catalog_validator/site_validator.rb +2 -0
  79. data/lib/puppet/parser/environment_compiler.rb +3 -0
  80. data/lib/puppet/parser/functions.rb +1 -1
  81. data/lib/puppet/parser/functions/epp.rb +3 -3
  82. data/lib/puppet/parser/functions/inline_epp.rb +5 -5
  83. data/lib/puppet/parser/resource.rb +3 -2
  84. data/lib/puppet/parser/resource/param.rb +6 -0
  85. data/lib/puppet/pops/evaluator/access_operator.rb +2 -2
  86. data/lib/puppet/pops/evaluator/collectors/catalog_collector.rb +1 -1
  87. data/lib/puppet/pops/evaluator/collectors/exported_collector.rb +1 -1
  88. data/lib/puppet/pops/evaluator/evaluator_impl.rb +1 -1
  89. data/lib/puppet/pops/evaluator/external_syntax_support.rb +3 -2
  90. data/lib/puppet/pops/evaluator/runtime3_support.rb +4 -4
  91. data/lib/puppet/pops/issues.rb +5 -0
  92. data/lib/puppet/pops/loaders.rb +1 -1
  93. data/lib/puppet/pops/lookup/hiera_config.rb +1 -0
  94. data/lib/puppet/pops/lookup/sub_lookup.rb +1 -1
  95. data/lib/puppet/pops/merge_strategy.rb +22 -18
  96. data/lib/puppet/pops/parser/heredoc_support.rb +1 -1
  97. data/lib/puppet/pops/parser/interpolation_support.rb +4 -4
  98. data/lib/puppet/pops/parser/locator.rb +1 -1
  99. data/lib/puppet/pops/parser/pn_parser.rb +17 -16
  100. data/lib/puppet/pops/puppet_stack.rb +51 -48
  101. data/lib/puppet/pops/resource/resource_type_impl.rb +2 -0
  102. data/lib/puppet/pops/types/p_sensitive_type.rb +1 -1
  103. data/lib/puppet/pops/types/string_converter.rb +10 -10
  104. data/lib/puppet/pops/types/type_calculator.rb +24 -0
  105. data/lib/puppet/pops/types/types.rb +3 -3
  106. data/lib/puppet/pops/validation/checker4_0.rb +10 -0
  107. data/lib/puppet/pops/validation/validator_factory_4_0.rb +1 -0
  108. data/lib/puppet/property.rb +1 -1
  109. data/lib/puppet/property/ensure.rb +1 -1
  110. data/lib/puppet/provider/augeas/augeas.rb +1 -1
  111. data/lib/puppet/provider/cron/crontab.rb +1 -1
  112. data/lib/puppet/provider/exec.rb +6 -2
  113. data/lib/puppet/provider/file/posix.rb +5 -0
  114. data/lib/puppet/provider/group/groupadd.rb +19 -19
  115. data/lib/puppet/provider/group/windows_adsi.rb +3 -3
  116. data/lib/puppet/provider/mailalias/aliases.rb +1 -1
  117. data/lib/puppet/provider/mount.rb +1 -1
  118. data/lib/puppet/provider/mount/parsed.rb +8 -8
  119. data/lib/puppet/provider/nameservice.rb +10 -3
  120. data/lib/puppet/provider/nameservice/directoryservice.rb +1 -1
  121. data/lib/puppet/provider/nameservice/pw.rb +2 -2
  122. data/lib/puppet/provider/package/aix.rb +17 -2
  123. data/lib/puppet/provider/package/apt.rb +14 -3
  124. data/lib/puppet/provider/package/dnf.rb +1 -1
  125. data/lib/puppet/provider/package/dnfmodule.rb +141 -0
  126. data/lib/puppet/provider/package/dpkg.rb +16 -18
  127. data/lib/puppet/provider/package/fink.rb +20 -3
  128. data/lib/puppet/provider/package/openbsd.rb +14 -2
  129. data/lib/puppet/provider/package/pip.rb +37 -10
  130. data/lib/puppet/provider/package/pkg.rb +18 -5
  131. data/lib/puppet/provider/package/pkgdmg.rb +1 -1
  132. data/lib/puppet/provider/package/pkgng.rb +16 -4
  133. data/lib/puppet/provider/package/portage.rb +4 -4
  134. data/lib/puppet/provider/package/rpm.rb +57 -19
  135. data/lib/puppet/provider/package/windows/package.rb +1 -1
  136. data/lib/puppet/provider/package/yum.rb +35 -24
  137. data/lib/puppet/provider/package/zypper.rb +1 -0
  138. data/lib/puppet/provider/package_targetable.rb +5 -4
  139. data/lib/puppet/provider/parsedfile.rb +1 -1
  140. data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +3 -3
  141. data/lib/puppet/provider/selmodule/semodule.rb +43 -26
  142. data/lib/puppet/provider/service/daemontools.rb +9 -9
  143. data/lib/puppet/provider/service/launchd.rb +20 -5
  144. data/lib/puppet/provider/service/openbsd.rb +1 -1
  145. data/lib/puppet/provider/service/rcng.rb +2 -2
  146. data/lib/puppet/provider/service/runit.rb +2 -8
  147. data/lib/puppet/provider/service/systemd.rb +35 -22
  148. data/lib/puppet/provider/service/windows.rb +8 -0
  149. data/lib/puppet/provider/user/directoryservice.rb +31 -6
  150. data/lib/puppet/provider/user/hpux.rb +1 -1
  151. data/lib/puppet/provider/user/pw.rb +12 -3
  152. data/lib/puppet/provider/user/user_role_add.rb +5 -1
  153. data/lib/puppet/provider/user/useradd.rb +62 -27
  154. data/lib/puppet/provider/user/windows_adsi.rb +4 -5
  155. data/lib/puppet/provider/yumrepo/inifile.rb +2 -2
  156. data/lib/puppet/reference/indirection.rb +2 -2
  157. data/lib/puppet/reference/metaparameter.rb +1 -3
  158. data/lib/puppet/reference/providers.rb +1 -1
  159. data/lib/puppet/reference/type.rb +3 -9
  160. data/lib/puppet/reports.rb +1 -1
  161. data/lib/puppet/resource.rb +18 -1
  162. data/lib/puppet/resource/catalog.rb +1 -1
  163. data/lib/puppet/resource/type.rb +8 -0
  164. data/lib/puppet/settings.rb +43 -3
  165. data/lib/puppet/settings/environment_conf.rb +1 -0
  166. data/lib/puppet/ssl/certificate.rb +2 -1
  167. data/lib/puppet/ssl/certificate_authority.rb +6 -5
  168. data/lib/puppet/ssl/certificate_authority/interface.rb +1 -1
  169. data/lib/puppet/ssl/certificate_factory.rb +2 -2
  170. data/lib/puppet/ssl/host.rb +3 -3
  171. data/lib/puppet/ssl/oids.rb +1 -1
  172. data/lib/puppet/test/test_helper.rb +15 -10
  173. data/lib/puppet/transaction/report.rb +1 -1
  174. data/lib/puppet/transaction/resource_harness.rb +1 -1
  175. data/lib/puppet/type.rb +15 -4
  176. data/lib/puppet/type/cron.rb +1 -1
  177. data/lib/puppet/type/exec.rb +21 -9
  178. data/lib/puppet/type/file.rb +14 -2
  179. data/lib/puppet/type/file/data_sync.rb +5 -1
  180. data/lib/puppet/type/group.rb +4 -2
  181. data/lib/puppet/type/interface.rb +1 -1
  182. data/lib/puppet/type/notify.rb +3 -2
  183. data/lib/puppet/type/package.rb +107 -8
  184. data/lib/puppet/type/schedule.rb +1 -1
  185. data/lib/puppet/type/selboolean.rb +17 -3
  186. data/lib/puppet/type/service.rb +9 -10
  187. data/lib/puppet/type/user.rb +6 -24
  188. data/lib/puppet/type/yumrepo.rb +3 -7
  189. data/lib/puppet/util.rb +47 -25
  190. data/lib/puppet/util/command_line/trollop.rb +1 -1
  191. data/lib/puppet/util/execution.rb +4 -3
  192. data/lib/puppet/util/http_proxy.rb +24 -16
  193. data/lib/puppet/util/instance_loader.rb +1 -1
  194. data/lib/puppet/util/log.rb +1 -1
  195. data/lib/puppet/util/log/destinations.rb +3 -12
  196. data/lib/puppet/util/logging.rb +30 -18
  197. data/lib/puppet/util/metric.rb +2 -2
  198. data/lib/puppet/util/monkey_patches.rb +1 -1
  199. data/lib/puppet/util/nagios_maker.rb +2 -2
  200. data/lib/puppet/util/network_device/cisco/device.rb +1 -1
  201. data/lib/puppet/util/network_device/cisco/interface.rb +2 -2
  202. data/lib/puppet/util/network_device/transport/ssh.rb +1 -1
  203. data/lib/puppet/util/pidlock.rb +12 -6
  204. data/lib/puppet/util/plist.rb +6 -0
  205. data/lib/puppet/util/provider_features.rb +2 -4
  206. data/lib/puppet/util/rdoc.rb +1 -1
  207. data/lib/puppet/util/reference.rb +1 -1
  208. data/lib/puppet/util/resource_template.rb +1 -1
  209. data/lib/puppet/util/selinux.rb +8 -2
  210. data/lib/puppet/util/windows/adsi.rb +60 -30
  211. data/lib/puppet/util/windows/api_types.rb +45 -32
  212. data/lib/puppet/util/windows/eventlog.rb +1 -6
  213. data/lib/puppet/util/windows/principal.rb +8 -6
  214. data/lib/puppet/util/windows/process.rb +16 -15
  215. data/lib/puppet/util/windows/registry.rb +17 -15
  216. data/lib/puppet/util/windows/security.rb +3 -0
  217. data/lib/puppet/util/windows/service.rb +149 -4
  218. data/lib/puppet/util/windows/sid.rb +4 -3
  219. data/lib/puppet/vendor.rb +1 -1
  220. data/lib/puppet/version.rb +1 -1
  221. data/lib/puppet_pal.rb +2 -2
  222. data/locales/puppet.pot +479 -443
  223. data/man/man5/puppet.conf.5 +38 -8
  224. data/man/man8/puppet-agent.8 +2 -2
  225. data/man/man8/puppet-apply.8 +1 -1
  226. data/man/man8/puppet-ca.8 +1 -1
  227. data/man/man8/puppet-catalog.8 +1 -1
  228. data/man/man8/puppet-cert.8 +1 -1
  229. data/man/man8/puppet-certificate.8 +1 -1
  230. data/man/man8/puppet-certificate_request.8 +1 -1
  231. data/man/man8/puppet-certificate_revocation_list.8 +1 -1
  232. data/man/man8/puppet-config.8 +1 -1
  233. data/man/man8/puppet-describe.8 +1 -1
  234. data/man/man8/puppet-device.8 +1 -1
  235. data/man/man8/puppet-doc.8 +1 -1
  236. data/man/man8/puppet-epp.8 +1 -1
  237. data/man/man8/puppet-facts.8 +1 -1
  238. data/man/man8/puppet-filebucket.8 +16 -1
  239. data/man/man8/puppet-generate.8 +1 -1
  240. data/man/man8/puppet-help.8 +1 -1
  241. data/man/man8/puppet-key.8 +1 -1
  242. data/man/man8/puppet-lookup.8 +1 -1
  243. data/man/man8/puppet-man.8 +1 -1
  244. data/man/man8/puppet-master.8 +1 -1
  245. data/man/man8/puppet-module.8 +1 -1
  246. data/man/man8/puppet-node.8 +1 -1
  247. data/man/man8/puppet-parser.8 +1 -1
  248. data/man/man8/puppet-plugin.8 +1 -1
  249. data/man/man8/puppet-report.8 +1 -1
  250. data/man/man8/puppet-resource.8 +1 -1
  251. data/man/man8/puppet-script.8 +1 -1
  252. data/man/man8/puppet-status.8 +1 -1
  253. data/man/man8/puppet.8 +2 -2
  254. data/spec/fixtures/integration/provider/mailalias/aliases/test1 +1 -0
  255. data/spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list.txt +19 -0
  256. data/spec/fixtures/unit/provider/package/pkgng/pkg.version +2 -0
  257. data/spec/fixtures/unit/provider/package/yum/yum-check-update-subscription-manager.txt +9 -0
  258. data/spec/fixtures/unit/provider/service/systemd/list_unit_files_services +9 -0
  259. data/spec/integration/configurer_spec.rb +52 -0
  260. data/spec/integration/defaults_spec.rb +1 -2
  261. data/spec/integration/indirector/facts/facter_spec.rb +4 -0
  262. data/spec/integration/parser/compiler_spec.rb +11 -0
  263. data/spec/integration/provider/service/systemd_spec.rb +8 -5
  264. data/spec/integration/type/file_spec.rb +28 -0
  265. data/spec/integration/type/notify_spec.rb +46 -0
  266. data/spec/integration/util/execution_spec.rb +27 -0
  267. data/spec/integration/util/windows/adsi_spec.rb +6 -1
  268. data/spec/integration/util/windows/registry_spec.rb +7 -7
  269. data/spec/unit/agent_spec.rb +34 -26
  270. data/spec/unit/application/agent_spec.rb +18 -0
  271. data/spec/unit/application/apply_spec.rb +2 -12
  272. data/spec/unit/application/device_spec.rb +1 -1
  273. data/spec/unit/configurer/fact_handler_spec.rb +0 -4
  274. data/spec/unit/configurer_spec.rb +377 -397
  275. data/spec/unit/daemon_spec.rb +0 -1
  276. data/spec/unit/face/facts_spec.rb +9 -0
  277. data/spec/unit/face/plugin_spec.rb +8 -0
  278. data/spec/unit/file_system/uniquefile_spec.rb +11 -0
  279. data/spec/unit/forge/forge_spec.rb +1 -3
  280. data/spec/unit/forge/repository_spec.rb +1 -3
  281. data/spec/unit/indirector/catalog/compiler_spec.rb +45 -26
  282. data/spec/unit/indirector/resource/ral_spec.rb +4 -4
  283. data/spec/unit/module_tool/tar/mini_spec.rb +1 -1
  284. data/spec/unit/network/http/api/indirected_routes_spec.rb +28 -11
  285. data/spec/unit/network/http/connection_spec.rb +43 -1
  286. data/spec/unit/network/http/factory_spec.rb +27 -5
  287. data/spec/unit/network/http/pool_spec.rb +32 -0
  288. data/spec/unit/node_spec.rb +7 -4
  289. data/spec/unit/parser/environment_compiler_spec.rb +7 -0
  290. data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +8 -3
  291. data/spec/unit/pops/validator/validator_spec.rb +7 -0
  292. data/spec/unit/provider/exec_spec.rb +209 -0
  293. data/spec/unit/provider/group/groupadd_spec.rb +30 -1
  294. data/spec/unit/provider/group/windows_adsi_spec.rb +43 -10
  295. data/spec/unit/provider/package/aix_spec.rb +29 -0
  296. data/spec/unit/provider/package/apt_spec.rb +13 -2
  297. data/spec/unit/provider/package/aptitude_spec.rb +1 -0
  298. data/spec/unit/provider/package/aptrpm_spec.rb +1 -1
  299. data/spec/unit/provider/package/dnf_spec.rb +7 -0
  300. data/spec/unit/provider/package/dnfmodule_spec.rb +247 -0
  301. data/spec/unit/provider/package/dpkg_spec.rb +35 -7
  302. data/spec/unit/provider/package/openbsd_spec.rb +17 -0
  303. data/spec/unit/provider/package/pip_spec.rb +93 -22
  304. data/spec/unit/provider/package/pkg_spec.rb +13 -1
  305. data/spec/unit/provider/package/pkgdmg_spec.rb +1 -1
  306. data/spec/unit/provider/package/pkgng_spec.rb +36 -0
  307. data/spec/unit/provider/package/portage_spec.rb +4 -4
  308. data/spec/unit/provider/package/rpm_spec.rb +150 -16
  309. data/spec/unit/provider/package/yum_spec.rb +66 -0
  310. data/spec/unit/provider/package/zypper_spec.rb +13 -0
  311. data/spec/unit/provider/package_targetable_spec.rb +60 -0
  312. data/spec/unit/provider/selmodule_spec.rb +118 -47
  313. data/spec/unit/provider/service/daemontools_spec.rb +24 -0
  314. data/spec/unit/provider/service/launchd_spec.rb +28 -0
  315. data/spec/unit/provider/service/runit_spec.rb +24 -0
  316. data/spec/unit/provider/service/systemd_spec.rb +109 -36
  317. data/spec/unit/provider/service/windows_spec.rb +20 -0
  318. data/spec/unit/provider/user/directoryservice_spec.rb +41 -0
  319. data/spec/unit/provider/user/hpux_spec.rb +2 -2
  320. data/spec/unit/provider/user/openbsd_spec.rb +1 -0
  321. data/spec/unit/provider/user/pw_spec.rb +37 -0
  322. data/spec/unit/provider/user/useradd_spec.rb +122 -15
  323. data/spec/unit/provider/user/windows_adsi_spec.rb +3 -3
  324. data/spec/unit/puppet_pal_2pec.rb +3 -0
  325. data/spec/unit/resource_spec.rb +26 -1
  326. data/spec/unit/ssl/certificate_authority_spec.rb +2 -3
  327. data/spec/unit/ssl/certificate_spec.rb +7 -0
  328. data/spec/unit/test/test_helper_spec.rb +17 -0
  329. data/spec/unit/transaction_spec.rb +18 -0
  330. data/spec/unit/type/exec_spec.rb +15 -12
  331. data/spec/unit/type/file/content_spec.rb +9 -3
  332. data/spec/unit/type/file/source_spec.rb +4 -4
  333. data/spec/unit/type/file_spec.rb +9 -4
  334. data/spec/unit/type/package_spec.rb +8 -0
  335. data/spec/unit/type/schedule_spec.rb +3 -1
  336. data/spec/unit/type/selboolean_spec.rb +4 -6
  337. data/spec/unit/type/service_spec.rb +25 -8
  338. data/spec/unit/type/user_spec.rb +32 -26
  339. data/spec/unit/type/yumrepo_spec.rb +30 -0
  340. data/spec/unit/type_spec.rb +40 -0
  341. data/spec/unit/util/execution_spec.rb +16 -0
  342. data/spec/unit/util/http_proxy_spec.rb +121 -1
  343. data/spec/unit/util/log/destinations_spec.rb +2 -26
  344. data/spec/unit/util/log_spec.rb +0 -112
  345. data/spec/unit/util/logging_spec.rb +200 -0
  346. data/spec/unit/util/pidlock_spec.rb +67 -40
  347. data/spec/unit/util/plist_spec.rb +20 -0
  348. data/spec/unit/util/windows/adsi_spec.rb +55 -4
  349. data/spec/unit/util/windows/api_types_spec.rb +104 -40
  350. data/spec/unit/util/windows/service_spec.rb +9 -0
  351. data/spec/unit/util/windows/sid_spec.rb +2 -2
  352. data/tasks/manpages.rake +1 -0
  353. metadata +16 -11
  354. data/ext/windows/eventlog/Rakefile +0 -32
  355. data/ext/windows/eventlog/puppetres.dll +0 -0
  356. data/ext/windows/eventlog/puppetres.mc +0 -18
  357. data/lib/puppet/pops/loader/null_loader.rb +0 -60
  358. data/locales/ja/puppet.po +0 -12114
  359. data/spec/integration/test/test_helper_spec.rb +0 -31
@@ -81,7 +81,7 @@ Puppet::Indirector::Face.define(:facts, '0.0.1') do
81
81
  node: Puppet[:node_name_value],
82
82
  server: server})
83
83
 
84
- Puppet::Node::Facts.indirection.save(facts)
84
+ Puppet::Node::Facts.indirection.save(facts, nil, :environment => Puppet.lookup(:current_environment))
85
85
  end
86
86
  end
87
87
  end
@@ -128,10 +128,10 @@ Puppet::Face.define(:module, '1.0.0') do
128
128
  unmet_grouped.each do |type, deps|
129
129
  unless deps.empty?
130
130
  unmet_grouped[type].sort_by { |dep| dep[:name] }.each do |dep|
131
- dep_name = dep[:name].gsub('/', '-')
131
+ dep_name = dep[:name].tr('/', '-')
132
132
  installed_version = dep[:mod_details][:installed_version]
133
133
  version_constraint = dep[:version_constraint]
134
- parent_name = dep[:parent][:name].gsub('/', '-')
134
+ parent_name = dep[:parent][:name].tr('/', '-')
135
135
  parent_version = dep[:parent][:version]
136
136
 
137
137
  msg = _("'%{parent_name}' (%{parent_version}) requires '%{dependency_name}' (%{dependency_version})") % { parent_name: parent_name, parent_version: parent_version, dependency_name: dep_name, dependency_version: version_constraint }
@@ -151,7 +151,7 @@ Puppet::Face.define(:module, '1.0.0') do
151
151
  error_display_order.each do |type|
152
152
  unless @unmet_deps[type].empty?
153
153
  @unmet_deps[type].keys.sort.each do |dep|
154
- name = dep.gsub('/', '-')
154
+ name = dep.tr('/', '-')
155
155
  errors = @unmet_deps[type][dep][:errors]
156
156
  version = @unmet_deps[type][dep][:version]
157
157
 
@@ -219,7 +219,7 @@ Puppet::Face.define(:module, '1.0.0') do
219
219
  dep[:reason] == :missing
220
220
  end
221
221
  missing_deps.map do |mis_mod|
222
- str = "#{colorize(:bg_red, _('UNMET DEPENDENCY'))} #{mis_mod[:name].gsub('/', '-')} "
222
+ str = "#{colorize(:bg_red, _('UNMET DEPENDENCY'))} #{mis_mod[:name].tr('/', '-')} "
223
223
  str << "(#{colorize(:cyan, mis_mod[:version_constraint])})"
224
224
  node[:dependencies] << { :text => str }
225
225
  end
@@ -244,7 +244,7 @@ Puppet::Face.define(:module, '1.0.0') do
244
244
  #
245
245
  def list_build_node(mod, parent, params)
246
246
  str = ''
247
- str << (mod.forge_name ? mod.forge_name.gsub('/', '-') : mod.name)
247
+ str << (mod.forge_name ? mod.forge_name.tr('/', '-') : mod.name)
248
248
  str << ' (' + colorize(:cyan, mod.version ? "v#{mod.version}" : '???') + ')'
249
249
 
250
250
  unless File.dirname(mod.path) == params[:path]
@@ -81,7 +81,7 @@ Puppet::Face.define(:module, '1.0.0') do
81
81
 
82
82
  highlight = proc do |s|
83
83
  s = s.gsub(term, colorize(:green, term))
84
- s = s.gsub(term.gsub('/', '-'), colorize(:green, term.gsub('/', '-'))) if term =~ /\//
84
+ s = s.gsub(term.tr('/', '-'), colorize(:green, term.tr('/', '-'))) if term =~ /\//
85
85
  s = s.gsub(' DEPRECATED', colorize(:red, ' DEPRECATED'))
86
86
  s
87
87
  end
@@ -61,7 +61,7 @@ Puppet::Face.define(:module, '1.0.0') do
61
61
  end
62
62
 
63
63
  when_invoked do |name, options|
64
- name = name.gsub('/', '-')
64
+ name = name.tr('/', '-')
65
65
 
66
66
  Puppet::ModuleTool.set_option_defaults options
67
67
  message = if options[:version]
@@ -67,7 +67,7 @@ Puppet::Face.define(:module, '1.0.0') do
67
67
  end
68
68
 
69
69
  when_invoked do |name, options|
70
- name = name.gsub('/', '-')
70
+ name = name.tr('/', '-')
71
71
  Puppet.notice _("Preparing to upgrade '%{name}' ...") % { name: name }
72
72
  Puppet::ModuleTool.set_option_defaults options
73
73
  Puppet::ModuleTool::Applications::Upgrader.new(name, options).run
@@ -41,8 +41,15 @@ Puppet::Face.define(:plugin, '0.0.1') do
41
41
  when_invoked do |options|
42
42
  remote_environment_for_plugins = Puppet::Node::Environment.remote(Puppet[:environment])
43
43
 
44
- handler = Puppet::Configurer::PluginHandler.new()
45
- handler.download_plugins(remote_environment_for_plugins)
44
+ pool = Puppet::Network::HTTP::Pool.new(Puppet[:http_keepalive_timeout])
45
+ Puppet.override(:http_pool => pool) do
46
+ begin
47
+ handler = Puppet::Configurer::PluginHandler.new()
48
+ handler.download_plugins(remote_environment_for_plugins)
49
+ ensure
50
+ pool.close
51
+ end
52
+ end
46
53
  end
47
54
 
48
55
  when_rendering :console do |value|
@@ -40,7 +40,7 @@ class Puppet::FileServing::HttpMetadata < Puppet::FileServing::Metadata
40
40
  [ @checksum_type, :md5, :sha256, :sha384, :sha512, :sha224, :mtime ].each do |type|
41
41
  @checksum_type = type
42
42
  @checksum = @checksums[type]
43
- return if @checksum
43
+ break if @checksum
44
44
  end
45
45
  end
46
46
  end
@@ -89,14 +89,6 @@ module Puppet::FileSystem
89
89
  @impl.path_string(@impl.basename(assert_path(path)))
90
90
  end
91
91
 
92
- # @return [Integer] the size of the file
93
- #
94
- # @api public
95
- #
96
- def self.size(path)
97
- @impl.size(assert_path(path))
98
- end
99
-
100
92
  # Allows exclusive updates to a file to be made by excluding concurrent
101
93
  # access using flock. This means that if the file is on a filesystem that
102
94
  # does not support flock, this method will provide no protection.
@@ -61,6 +61,6 @@ class Puppet::FileSystem::MemoryFile
61
61
  end
62
62
 
63
63
  def inspect
64
- "<Puppet::FileSystem::MemoryFile:#{to_s}>"
64
+ "<Puppet::FileSystem::MemoryFile:#{self}>"
65
65
  end
66
66
  end
@@ -14,11 +14,12 @@ class Puppet::FileSystem::Posix < Puppet::FileSystem::FileImpl
14
14
  bsize = stream_blksize(this, stream)
15
15
  sa = "".force_encoding('ASCII-8BIT')
16
16
  sb = "".force_encoding('ASCII-8BIT')
17
- begin
17
+ loop do
18
18
  this.read(bsize, sa)
19
19
  stream.read(bsize, sb)
20
20
  return true if sa.empty? && sb.empty?
21
- end while sa == sb
21
+ break if sa != sb
22
+ end
22
23
  false
23
24
  end
24
25
  end
@@ -174,6 +174,10 @@ class Puppet::FileSystem::Uniquefile < DelegateClass(File)
174
174
  lock = tmpname + '.lock'
175
175
  mkdir(lock)
176
176
  yield
177
+ rescue Errno::ENOENT => e
178
+ ex = Errno::ENOENT.new("A directory component in #{lock} does not exist or is a dangling symbolic link")
179
+ ex.set_backtrace(e.backtrace)
180
+ raise ex
177
181
  ensure
178
182
  rmdir(lock) if Puppet::FileSystem.exist?(lock)
179
183
  end
@@ -59,7 +59,7 @@ class Puppet::Forge < SemanticPuppet::Dependency::Source
59
59
  matches = []
60
60
  uri = "/v3/modules?query=#{term}"
61
61
  if Puppet[:module_groups]
62
- uri += "&module_groups=#{Puppet[:module_groups].gsub('+', ' ')}"
62
+ uri += "&module_groups=#{Puppet[:module_groups].tr('+', ' ')}"
63
63
  end
64
64
 
65
65
  while uri
@@ -95,7 +95,7 @@ class Puppet::Forge < SemanticPuppet::Dependency::Source
95
95
  name = input.tr('/', '-')
96
96
  uri = "/v3/releases?module=#{name}&sort_by=version&exclude_fields=#{MODULE_RELEASE_EXCLUSIONS}"
97
97
  if Puppet[:module_groups]
98
- uri += "&module_groups=#{Puppet[:module_groups].gsub('+', ' ')}"
98
+ uri += "&module_groups=#{Puppet[:module_groups].tr('+', ' ')}"
99
99
  end
100
100
  releases = []
101
101
 
@@ -240,6 +240,6 @@ class Puppet::Forge < SemanticPuppet::Dependency::Source
240
240
  def decode_uri(uri)
241
241
  return if uri.nil?
242
242
 
243
- URI.decode(uri.gsub('+', ' '))
243
+ URI.decode(uri.tr('+', ' '))
244
244
  end
245
245
  end
@@ -6,12 +6,12 @@
6
6
  # The first argument to this function should be a `<MODULE NAME>/<TEMPLATE FILE>`
7
7
  # reference, which loads `<TEMPLATE FILE>` from `<MODULE NAME>`'s `templates`
8
8
  # directory. In most cases, the last argument is optional; if used, it should be a
9
- # [hash](/puppet/latest/reference/lang_data_hash.html) that contains parameters to
9
+ # [hash](https://puppet.com/docs/puppet/latest/lang_data_hash.html) that contains parameters to
10
10
  # pass to the template.
11
11
  #
12
- # - See the [template](/puppet/latest/reference/lang_template.html) documentation
13
- # for general template usage information.
14
- # - See the [EPP syntax](/puppet/latest/reference/lang_template_epp.html)
12
+ # - See the [template](https://puppet.com/docs/puppet/latest/lang_template.html)
13
+ # documentation for general template usage information.
14
+ # - See the [EPP syntax](https://puppet.com/docs/puppet/latest/lang_template_epp.html)
15
15
  # documentation for examples of EPP.
16
16
  #
17
17
  # For example, to call the apache module's `templates/vhost/_docroot.epp`
@@ -5,12 +5,12 @@
5
5
  #
6
6
  # The first argument to this function should be a string containing an EPP
7
7
  # template. In most cases, the last argument is optional; if used, it should be a
8
- # [hash](/puppet/latest/reference/lang_data_hash.html) that contains parameters to
8
+ # [hash](https://puppet.com/docs/puppet/latest/lang_data_hash.html) that contains parameters to
9
9
  # pass to the template.
10
10
  #
11
- # - See the [template](/puppet/latest/reference/lang_template.html) documentation
12
- # for general template usage information.
13
- # - See the [EPP syntax](/puppet/latest/reference/lang_template_epp.html)
11
+ # - See the [template](https://puppet.com/docs/puppet/latest/lang_template.html)
12
+ # documentation for general template usage information.
13
+ # - See the [EPP syntax](https://puppet.com/docs/puppet/latest/lang_template_epp.html)
14
14
  # documentation for examples of EPP.
15
15
  #
16
16
  # For example, to evaluate an inline EPP template and pass it the `docroot` and
@@ -28,7 +28,7 @@
28
28
  # `inline_epp` function fails to pass any required parameter.
29
29
  #
30
30
  # An inline EPP template should be written as a single-quoted string or
31
- # [heredoc](/puppet/latest/reference/lang_data_string.html#heredocs).
31
+ # [heredoc](https://puppet.com/docs/puppet/latest/lang_data_string.html#heredocs).
32
32
  # A double-quoted string is subject to expression interpolation before the string
33
33
  # is parsed as an EPP template.
34
34
  #
@@ -39,11 +39,9 @@
39
39
  # values to the lambda.
40
40
  #
41
41
  # Puppet calls the lambda for each of the data structure's remaining values. For each
42
- # call, it passes the result of the previous call as the first parameter ($memo in the
42
+ # call, it passes the result of the previous call as the first parameter (`$memo` in the
43
43
  # above examples) and the next value from the data structure as the second parameter
44
- # ($value).
45
- #
46
- # If the structure has one value, Puppet returns the value and does not call the lambda.
44
+ # (`$value`).
47
45
  #
48
46
  # @example Using the `reduce` function
49
47
  #
@@ -11,7 +11,7 @@ module Puppet::ModuleTranslations
11
11
  modules.each do |mod|
12
12
  next unless mod.forge_name && mod.has_translations?(Puppet::GettextConfig.current_locale)
13
13
 
14
- module_name = mod.forge_name.gsub('/', '-')
14
+ module_name = mod.forge_name.tr('/', '-')
15
15
  if Puppet::GettextConfig.load_translations(module_name, mod.locale_directory, :po)
16
16
  Puppet.debug "Loaded translations for #{module_name}."
17
17
  elsif Puppet::GettextConfig.gettext_loaded?
@@ -213,8 +213,8 @@ class Puppet::Graph::RbTreeMap
213
213
  :color => @color,
214
214
  }
215
215
  }
216
- h.merge!(:left => left.to_hash) if @left
217
- h.merge!(:right => right.to_hash) if @right
216
+ h[:left] = left.to_hash if @left
217
+ h[:right] = right.to_hash if @right
218
218
  h
219
219
  end
220
220
 
@@ -133,11 +133,12 @@ class Puppet::Graph::SimpleGraph
133
133
  else
134
134
  if s[:lowlink][vertex] == s[:index][vertex] then
135
135
  this_scc = []
136
- begin
136
+ loop do
137
137
  top = s[:stack].pop
138
138
  s[:seen][top] = false
139
139
  this_scc << top
140
- end until top == vertex
140
+ break if top == vertex
141
+ end
141
142
  s[:scc] << this_scc
142
143
  end
143
144
  recur.pop # done with this node, finally.
@@ -436,8 +437,8 @@ class Puppet::Graph::SimpleGraph
436
437
  # undirected Graph. _params_ can contain any graph property specified in
437
438
  # rdot.rb. If an edge or vertex label is a kind of Hash then the keys
438
439
  # which match +dot+ properties will be used as well.
439
- def to_dot_graph (params = {})
440
- params['name'] ||= self.class.name.gsub(/:/,'_')
440
+ def to_dot_graph(params = {})
441
+ params['name'] ||= self.class.name.tr(':','_')
441
442
  fontsize = params['fontsize'] ? params['fontsize'] : '8'
442
443
  graph = (directed? ? DOT::DOTDigraph : DOT::DOTSubgraph).new(params)
443
444
  edge_klass = directed? ? DOT::DOTDirectedEdge : DOT::DOTEdge
@@ -462,7 +463,7 @@ class Puppet::Graph::SimpleGraph
462
463
  end
463
464
 
464
465
  # Output the dot format as a string
465
- def to_dot (params={}) to_dot_graph(params).to_s; end
466
+ def to_dot(params={}) to_dot_graph(params).to_s; end
466
467
 
467
468
  # Produce the graph files if requested.
468
469
  def write_graph(name)
@@ -387,9 +387,17 @@ class Puppet::Resource::Catalog::Compiler < Puppet::Indirector::Code
387
387
 
388
388
  # Initialize our server fact hash; we add these to each client, and they
389
389
  # won't change while we're running, so it's safe to cache the values.
390
+ #
391
+ # See also set_server_facts in Puppet::Server::Compiler in puppetserver.
390
392
  def set_server_facts
391
393
  @server_facts = {}
392
394
 
395
+ # Add our server Puppet Enterprise version, if available.
396
+ pe_version_file = '/opt/puppetlabs/server/pe_version'
397
+ if File.readable?(pe_version_file) and !File.zero?(pe_version_file)
398
+ @server_facts['pe_serverversion'] = File.read(pe_version_file).chomp
399
+ end
400
+
393
401
  # Add our server version to the fact list
394
402
  @server_facts["serverversion"] = Puppet.version.to_s
395
403
 
@@ -15,7 +15,7 @@ module Puppet::FileBucketFile
15
15
  request.options[:bucket_path] ||= Puppet[:bucketdir]
16
16
  # If filebucket mode is 'list'
17
17
  if request.options[:list_all]
18
- return nil unless ::File.exists?(request.options[:bucket_path])
18
+ return nil unless ::File.exist?(request.options[:bucket_path])
19
19
  return list(request)
20
20
  end
21
21
  checksum, files_original_path = request_to_checksum_and_path(request)
@@ -69,6 +69,8 @@ class Puppet::Indirector::Hiera < Puppet::Indirector::Terminus
69
69
  end
70
70
  end
71
71
 
72
+ public
73
+
72
74
  def self.hiera_config
73
75
  hiera_config = Puppet.settings[:hiera_config]
74
76
  config = {}
@@ -25,9 +25,7 @@ class Puppet::Resource::Ral < Puppet::Indirector::Code
25
25
  res.to_resource
26
26
  end.find_all do |res|
27
27
  conditions.all? {|property, value| res.to_resource[property].to_s == value.to_s}
28
- end.sort do |a,b|
29
- a.title <=> b.title
30
- end
28
+ end.sort_by(&:title)
31
29
  end
32
30
 
33
31
  def save( request )
@@ -1,7 +1,7 @@
1
1
  module Puppet::Resource::Validator
2
2
  def validate_key(request)
3
3
  type, title = request.key.split('/', 2)
4
- unless type.downcase == request.instance.type.downcase and title == request.instance.title
4
+ unless type.casecmp(request.instance.type).zero? and title == request.instance.title
5
5
  raise Puppet::Indirector::ValidationError, _("Resource instance does not match request key")
6
6
  end
7
7
  end
@@ -96,7 +96,7 @@ class Puppet::Interface
96
96
  if Puppet::Interface::FaceCollection[name, :current]
97
97
  raise Puppet::Error, "Could not find version #{version} of #{name}"
98
98
  else
99
- raise Puppet::Error, "Could not find Puppet Face #{name.to_s}"
99
+ raise Puppet::Error, "Could not find Puppet Face #{name}"
100
100
  end
101
101
  end
102
102
 
@@ -234,4 +234,5 @@ class Puppet::Interface
234
234
  define_method(name, proc)
235
235
  instance_method(name)
236
236
  end
237
+ private_class_method :__add_method
237
238
  end
@@ -9,7 +9,6 @@ module Puppet
9
9
  require 'puppet/pops/loader/gem_support'
10
10
  require 'puppet/pops/loader/module_loaders'
11
11
  require 'puppet/pops/loader/dependency_loader'
12
- require 'puppet/pops/loader/null_loader'
13
12
  require 'puppet/pops/loader/static_loader'
14
13
  require 'puppet/pops/loader/runtime3_type_loader'
15
14
  require 'puppet/pops/loader/ruby_function_instantiator'
@@ -123,7 +123,7 @@ module Manager
123
123
 
124
124
  # Now set up autoload any providers that might exist for this type.
125
125
 
126
- klass.providerloader = Puppet::Util::Autoload.new(klass, "puppet/provider/#{klass.name.to_s}")
126
+ klass.providerloader = Puppet::Util::Autoload.new(klass, "puppet/provider/#{klass.name}")
127
127
 
128
128
  # We have to load everything so that we can figure out the default provider.
129
129
  klass.providerloader.loadall Puppet.lookup(:current_environment)
@@ -225,7 +225,7 @@ class Puppet::Module
225
225
  @metadata = data = read_metadata
226
226
  return if data.empty?
227
227
 
228
- @forge_name = data['name'].gsub('-', '/') if data['name']
228
+ @forge_name = data['name'].tr('-', '/') if data['name']
229
229
 
230
230
  [:source, :author, :version, :license, :dependencies].each do |attr|
231
231
  value = data[attr.to_s]
@@ -103,7 +103,7 @@ module Puppet::ModuleTool
103
103
  end
104
104
 
105
105
  # make dir tree, copy files, and add symlinks to the symlinks list
106
- dest = "#{build_path}/#{rel.to_s}"
106
+ dest = "#{build_path}/#{rel}"
107
107
  if File.directory? path
108
108
  FileUtils.mkdir dest, :mode => File.stat(path).mode
109
109
  elsif Puppet::FileSystem.symlink? path
@@ -304,7 +304,7 @@ module Puppet::ModuleTool
304
304
  @environment.modules_by_path[options[:target_dir]].each do |mod|
305
305
  if mod.has_metadata?
306
306
  metadata = {
307
- :name => mod.forge_name.gsub('/', '-'),
307
+ :name => mod.forge_name.tr('/', '-'),
308
308
  :version => mod.version
309
309
  }
310
310
  next if release[:module] == metadata[:name]
@@ -53,7 +53,7 @@ module Puppet::ModuleTool
53
53
 
54
54
  def find_installed_module
55
55
  @environment.modules_by_path.values.flatten.each do |mod|
56
- mod_name = (mod.forge_name || mod.name).gsub('/', '-')
56
+ mod_name = (mod.forge_name || mod.name).tr('/', '-')
57
57
  if mod_name == @name
58
58
  @unfiltered << {
59
59
  :name => mod_name,
@@ -102,7 +102,7 @@ module Puppet::ModuleTool
102
102
  if mod.has_metadata? && !changes.empty?
103
103
  raise LocalChangesError,
104
104
  :action => :uninstall,
105
- :module_name => (mod.forge_name || mod.name).gsub('/', '-'),
105
+ :module_name => (mod.forge_name || mod.name).tr('/', '-'),
106
106
  :requested_version => @options[:version],
107
107
  :installed_version => mod.version
108
108
  end
@@ -110,7 +110,7 @@ module Puppet::ModuleTool
110
110
 
111
111
  if !@options[:force] && !mod.required_by.empty?
112
112
  raise ModuleIsRequiredError,
113
- :module_name => (mod.forge_name || mod.name).gsub('/', '-'),
113
+ :module_name => (mod.forge_name || mod.name).tr('/', '-'),
114
114
  :required_by => mod.required_by,
115
115
  :requested_version => @options[:version],
116
116
  :installed_version => mod.version