puppet 5.3.3 → 5.3.4

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 (291) hide show
  1. data/CONTRIBUTING.md +1 -1
  2. data/Gemfile +3 -0
  3. data/ext/puppet-test +3 -2
  4. data/lib/hiera/puppet_function.rb +5 -2
  5. data/lib/hiera_puppet.rb +3 -3
  6. data/lib/puppet.rb +2 -5
  7. data/lib/puppet/agent.rb +22 -2
  8. data/lib/puppet/agent/locker.rb +6 -5
  9. data/lib/puppet/application.rb +18 -1
  10. data/lib/puppet/application/agent.rb +9 -2
  11. data/lib/puppet/application/apply.rb +1 -1
  12. data/lib/puppet/application/config.rb +1 -0
  13. data/lib/puppet/application/device.rb +1 -2
  14. data/lib/puppet/application/filebucket.rb +22 -5
  15. data/lib/puppet/application/help.rb +1 -0
  16. data/lib/puppet/application/lookup.rb +1 -3
  17. data/lib/puppet/application_support.rb +6 -1
  18. data/lib/puppet/bindings.rb +2 -1
  19. data/lib/puppet/configurer.rb +9 -4
  20. data/lib/puppet/configurer/downloader_factory.rb +10 -0
  21. data/lib/puppet/configurer/plugin_handler.rb +11 -4
  22. data/lib/puppet/daemon.rb +2 -2
  23. data/lib/puppet/defaults.rb +99 -27
  24. data/lib/puppet/environments.rb +2 -0
  25. data/lib/puppet/error.rb +5 -15
  26. data/lib/puppet/external/pson/common.rb +2 -2
  27. data/lib/puppet/face/catalog.rb +1 -1
  28. data/lib/puppet/face/config.rb +14 -1
  29. data/lib/puppet/face/epp.rb +4 -2
  30. data/lib/puppet/face/help.rb +12 -14
  31. data/lib/puppet/face/man.rb +1 -0
  32. data/lib/puppet/face/module/build.rb +1 -1
  33. data/lib/puppet/face/module/list.rb +6 -17
  34. data/lib/puppet/face/module/uninstall.rb +14 -3
  35. data/lib/puppet/face/node.rb +1 -0
  36. data/lib/puppet/face/status.rb +1 -0
  37. data/lib/puppet/file_serving/base.rb +2 -1
  38. data/lib/puppet/file_serving/configuration.rb +3 -0
  39. data/lib/puppet/file_serving/configuration/parser.rb +23 -9
  40. data/lib/puppet/file_serving/mount/locales.rb +35 -0
  41. data/lib/puppet/forge.rb +2 -1
  42. data/lib/puppet/forge/errors.rb +24 -22
  43. data/lib/puppet/functions/binary_file.rb +1 -0
  44. data/lib/puppet/functions/each.rb +10 -4
  45. data/lib/puppet/functions/eyaml_lookup_key.rb +4 -2
  46. data/lib/puppet/functions/lookup.rb +2 -2
  47. data/lib/puppet/functions/map.rb +12 -2
  48. data/lib/puppet/functions/slice.rb +2 -3
  49. data/lib/puppet/functions/unique.rb +1 -1
  50. data/lib/puppet/functions/yaml_data.rb +1 -1
  51. data/lib/puppet/gettext/config.rb +144 -41
  52. data/lib/puppet/gettext/module_translations.rb +42 -0
  53. data/lib/puppet/graph/relationship_graph.rb +1 -1
  54. data/lib/puppet/graph/simple_graph.rb +3 -3
  55. data/lib/puppet/indirector/catalog/compiler.rb +40 -25
  56. data/lib/puppet/indirector/exec.rb +1 -1
  57. data/lib/puppet/indirector/facts/facter.rb +3 -3
  58. data/lib/puppet/indirector/facts/network_device.rb +2 -2
  59. data/lib/puppet/indirector/file_bucket_file/file.rb +4 -1
  60. data/lib/puppet/indirector/indirection.rb +17 -9
  61. data/lib/puppet/indirector/ldap.rb +2 -2
  62. data/lib/puppet/indirector/node/write_only_yaml.rb +3 -1
  63. data/lib/puppet/indirector/rest.rb +8 -5
  64. data/lib/puppet/indirector/ssl_file.rb +2 -2
  65. data/lib/puppet/indirector/terminus.rb +3 -3
  66. data/lib/puppet/interface.rb +2 -1
  67. data/lib/puppet/interface/action.rb +41 -24
  68. data/lib/puppet/interface/action_builder.rb +14 -5
  69. data/lib/puppet/interface/action_manager.rb +1 -1
  70. data/lib/puppet/interface/documentation.rb +21 -10
  71. data/lib/puppet/interface/face_collection.rb +4 -2
  72. data/lib/puppet/interface/option.rb +36 -15
  73. data/lib/puppet/interface/option_builder.rb +23 -9
  74. data/lib/puppet/interface/option_manager.rb +8 -3
  75. data/lib/puppet/metatype/manager.rb +7 -3
  76. data/lib/puppet/module.rb +18 -21
  77. data/lib/puppet/module_tool/errors/installer.rb +18 -20
  78. data/lib/puppet/module_tool/errors/shared.rb +20 -15
  79. data/lib/puppet/module_tool/errors/uninstaller.rb +1 -0
  80. data/lib/puppet/module_tool/errors/upgrader.rb +1 -1
  81. data/lib/puppet/module_tool/tar/mini.rb +57 -4
  82. data/lib/puppet/network/auth_config_parser.rb +18 -13
  83. data/lib/puppet/network/authstore.rb +2 -2
  84. data/lib/puppet/network/client_request.rb +1 -1
  85. data/lib/puppet/network/format.rb +3 -3
  86. data/lib/puppet/network/http/api/indirection_type.rb +1 -1
  87. data/lib/puppet/network/http/api/master/v3/environment.rb +5 -2
  88. data/lib/puppet/network/http/error.rb +7 -7
  89. data/lib/puppet/network/http/factory.rb +9 -0
  90. data/lib/puppet/network/http/rack.rb +2 -2
  91. data/lib/puppet/network/http/webrick.rb +2 -4
  92. data/lib/puppet/node.rb +25 -6
  93. data/lib/puppet/node/environment.rb +14 -0
  94. data/lib/puppet/node/facts.rb +9 -0
  95. data/lib/puppet/parameter.rb +3 -3
  96. data/lib/puppet/parameter/value_collection.rb +9 -9
  97. data/lib/puppet/parser/ast/leaf.rb +1 -1
  98. data/lib/puppet/parser/ast/node.rb +2 -2
  99. data/lib/puppet/parser/ast/pops_bridge.rb +1 -1
  100. data/lib/puppet/parser/compiler.rb +6 -5
  101. data/lib/puppet/parser/functions.rb +1 -1
  102. data/lib/puppet/parser/functions/generate.rb +2 -4
  103. data/lib/puppet/parser/functions/inline_template.rb +1 -2
  104. data/lib/puppet/parser/functions/sprintf.rb +17 -3
  105. data/lib/puppet/parser/functions/template.rb +6 -2
  106. data/lib/puppet/parser/resource.rb +30 -31
  107. data/lib/puppet/parser/scope.rb +20 -11
  108. data/lib/puppet/parser/templatewrapper.rb +4 -3
  109. data/lib/puppet/pops/evaluator/collector_transformer.rb +2 -1
  110. data/lib/puppet/pops/evaluator/collectors/abstract_collector.rb +1 -1
  111. data/lib/puppet/pops/evaluator/epp_evaluator.rb +21 -8
  112. data/lib/puppet/pops/evaluator/evaluator_impl.rb +2 -1
  113. data/lib/puppet/pops/evaluator/external_syntax_support.rb +1 -1
  114. data/lib/puppet/pops/evaluator/runtime3_converter.rb +3 -1
  115. data/lib/puppet/pops/evaluator/runtime3_resource_support.rb +1 -1
  116. data/lib/puppet/pops/evaluator/runtime3_support.rb +4 -4
  117. data/lib/puppet/pops/functions/dispatch.rb +1 -1
  118. data/lib/puppet/pops/functions/function.rb +8 -2
  119. data/lib/puppet/pops/issue_reporter.rb +7 -2
  120. data/lib/puppet/pops/issues.rb +10 -4
  121. data/lib/puppet/pops/label_provider.rb +1 -1
  122. data/lib/puppet/pops/loader/module_loaders.rb +5 -2
  123. data/lib/puppet/pops/loader/static_loader.rb +1 -1
  124. data/lib/puppet/pops/loaders.rb +7 -3
  125. data/lib/puppet/pops/lookup/explainer.rb +2 -1
  126. data/lib/puppet/pops/lookup/hiera_config.rb +2 -2
  127. data/lib/puppet/pops/lookup/lookup_adapter.rb +4 -4
  128. data/lib/puppet/pops/merge_strategy.rb +6 -3
  129. data/lib/puppet/pops/migration/migration_checker.rb +8 -8
  130. data/lib/puppet/pops/model/ast_transformer.rb +1 -1
  131. data/lib/puppet/pops/model/factory.rb +4 -2
  132. data/lib/puppet/pops/resource/resource_type_impl.rb +1 -1
  133. data/lib/puppet/pops/serialization/abstract_writer.rb +2 -1
  134. data/lib/puppet/pops/types/iterable.rb +2 -0
  135. data/lib/puppet/pops/types/p_object_type.rb +36 -15
  136. data/lib/puppet/pops/types/type_calculator.rb +2 -1
  137. data/lib/puppet/pops/types/type_factory.rb +3 -1
  138. data/lib/puppet/pops/types/type_mismatch_describer.rb +19 -6
  139. data/lib/puppet/pops/types/type_parser.rb +7 -7
  140. data/lib/puppet/pops/types/types.rb +10 -4
  141. data/lib/puppet/pops/validation.rb +14 -12
  142. data/lib/puppet/property.rb +14 -6
  143. data/lib/puppet/property/ensure.rb +2 -2
  144. data/lib/puppet/provider.rb +4 -4
  145. data/lib/puppet/provider/group/aix.rb +4 -2
  146. data/lib/puppet/provider/ldap.rb +2 -2
  147. data/lib/puppet/provider/naginator.rb +1 -1
  148. data/lib/puppet/provider/nameservice.rb +7 -4
  149. data/lib/puppet/provider/nameservice/directoryservice.rb +4 -3
  150. data/lib/puppet/provider/package/aix.rb +1 -1
  151. data/lib/puppet/provider/package/nim.rb +7 -8
  152. data/lib/puppet/provider/package/opkg.rb +1 -1
  153. data/lib/puppet/provider/package/pkg.rb +9 -6
  154. data/lib/puppet/provider/package/pkgutil.rb +3 -3
  155. data/lib/puppet/provider/package/yum.rb +1 -1
  156. data/lib/puppet/provider/parsedfile.rb +4 -4
  157. data/lib/puppet/provider/selmodule/semodule.rb +5 -3
  158. data/lib/puppet/provider/service/base.rb +1 -1
  159. data/lib/puppet/provider/service/init.rb +1 -1
  160. data/lib/puppet/provider/service/launchd.rb +2 -2
  161. data/lib/puppet/provider/service/runit.rb +2 -1
  162. data/lib/puppet/provider/service/smf.rb +2 -0
  163. data/lib/puppet/provider/service/systemd.rb +1 -0
  164. data/lib/puppet/provider/service/upstart.rb +1 -1
  165. data/lib/puppet/provider/user/aix.rb +13 -6
  166. data/lib/puppet/provider/user/openbsd.rb +2 -1
  167. data/lib/puppet/provider/yumrepo/inifile.rb +2 -1
  168. data/lib/puppet/provider/zone/solaris.rb +2 -2
  169. data/lib/puppet/reference/configuration.rb +4 -2
  170. data/lib/puppet/relationship.rb +2 -1
  171. data/lib/puppet/reports/store.rb +1 -1
  172. data/lib/puppet/resource.rb +7 -5
  173. data/lib/puppet/resource/capability_finder.rb +14 -11
  174. data/lib/puppet/resource/catalog.rb +33 -18
  175. data/lib/puppet/resource/type.rb +5 -5
  176. data/lib/puppet/settings.rb +19 -13
  177. data/lib/puppet/settings/base_setting.rb +23 -8
  178. data/lib/puppet/settings/config_file.rb +14 -4
  179. data/lib/puppet/settings/environment_conf.rb +19 -9
  180. data/lib/puppet/ssl/base.rb +9 -4
  181. data/lib/puppet/ssl/oids.rb +8 -2
  182. data/lib/puppet/syntax_checkers/base64.rb +5 -6
  183. data/lib/puppet/transaction.rb +7 -3
  184. data/lib/puppet/transaction/persistence.rb +16 -1
  185. data/lib/puppet/transaction/report.rb +6 -0
  186. data/lib/puppet/type.rb +27 -35
  187. data/lib/puppet/type/file.rb +2 -1
  188. data/lib/puppet/type/file/data_sync.rb +2 -1
  189. data/lib/puppet/type/file/source.rb +1 -1
  190. data/lib/puppet/type/group.rb +1 -1
  191. data/lib/puppet/type/mount.rb +1 -1
  192. data/lib/puppet/type/resources.rb +1 -1
  193. data/lib/puppet/type/schedule.rb +26 -14
  194. data/lib/puppet/type/user.rb +9 -3
  195. data/lib/puppet/type/zone.rb +1 -1
  196. data/lib/puppet/util.rb +27 -21
  197. data/lib/puppet/util/at_fork/solaris.rb +6 -4
  198. data/lib/puppet/util/command_line.rb +5 -0
  199. data/lib/puppet/util/command_line/trollop.rb +6 -5
  200. data/lib/puppet/util/errors.rb +61 -8
  201. data/lib/puppet/util/fileparsing.rb +3 -5
  202. data/lib/puppet/util/http_proxy.rb +14 -6
  203. data/lib/puppet/util/instance_loader.rb +1 -3
  204. data/lib/puppet/util/ldap/manager.rb +6 -3
  205. data/lib/puppet/util/log.rb +19 -24
  206. data/lib/puppet/util/logging.rb +21 -28
  207. data/lib/puppet/util/methodhelper.rb +1 -1
  208. data/lib/puppet/util/nagios_maker.rb +1 -1
  209. data/lib/puppet/util/network_device/config.rb +21 -13
  210. data/lib/puppet/util/plist.rb +3 -1
  211. data/lib/puppet/util/posix.rb +1 -1
  212. data/lib/puppet/util/provider_features.rb +1 -1
  213. data/lib/puppet/util/rdoc/generators/puppet_generator.rb +1 -1
  214. data/lib/puppet/util/reference.rb +2 -3
  215. data/lib/puppet/util/selinux.rb +1 -1
  216. data/lib/puppet/util/storage.rb +2 -2
  217. data/lib/puppet/util/windows/eventlog.rb +10 -5
  218. data/lib/puppet/util/windows/file.rb +61 -9
  219. data/lib/puppet/util/windows/process.rb +1 -1
  220. data/lib/puppet/util/windows/taskscheduler.rb +2 -2
  221. data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet.rb +5 -1
  222. data/lib/puppet/version.rb +1 -1
  223. data/locales/en/puppet.po +19 -0
  224. data/locales/ja/puppet.po +2739 -809
  225. data/locales/puppet.pot +2367 -734
  226. data/spec/fixtures/unit/application/environments/production/data/common.yaml +2 -0
  227. data/spec/integration/agent/logging_spec.rb +2 -0
  228. data/spec/integration/faces/plugin_spec.rb +1 -0
  229. data/spec/integration/network/authconfig_spec.rb +2 -2
  230. data/spec/integration/parser/collection_spec.rb +2 -2
  231. data/spec/integration/parser/scope_spec.rb +16 -3
  232. data/spec/integration/provider/cron/crontab_spec.rb +1 -0
  233. data/spec/integration/transaction/report_spec.rb +5 -0
  234. data/spec/lib/matchers/json.rb +14 -13
  235. data/spec/unit/agent_spec.rb +33 -0
  236. data/spec/unit/application/config_spec.rb +4 -0
  237. data/spec/unit/application/lookup_spec.rb +30 -0
  238. data/spec/unit/application_spec.rb +18 -0
  239. data/spec/unit/configurer/downloader_factory_spec.rb +33 -0
  240. data/spec/unit/configurer/plugin_handler_spec.rb +71 -16
  241. data/spec/unit/environments_spec.rb +15 -0
  242. data/spec/unit/face/config_spec.rb +8 -9
  243. data/spec/unit/face/epp_face_spec.rb +2 -2
  244. data/spec/unit/face/plugin_spec.rb +50 -4
  245. data/spec/unit/file_serving/configuration/parser_spec.rb +2 -2
  246. data/spec/unit/file_serving/mount/locales_spec.rb +73 -0
  247. data/spec/unit/functions/break_spec.rb +108 -50
  248. data/spec/unit/functions/defined_spec.rb +2 -2
  249. data/spec/unit/functions/hiera_spec.rb +0 -1
  250. data/spec/unit/functions/lookup_spec.rb +85 -19
  251. data/spec/unit/functions/next_spec.rb +1 -1
  252. data/spec/unit/functions/return_spec.rb +2 -2
  253. data/spec/unit/gettext/config_spec.rb +125 -0
  254. data/spec/unit/gettext/module_loading_spec.rb +53 -0
  255. data/spec/unit/indirector/json_spec.rb +0 -11
  256. data/spec/unit/indirector/node/exec_spec.rb +1 -1
  257. data/spec/unit/info_service_spec.rb +1 -1
  258. data/spec/unit/interface_spec.rb +12 -0
  259. data/spec/unit/module_spec.rb +0 -28
  260. data/spec/unit/module_tool/tar/mini_spec.rb +34 -5
  261. data/spec/unit/network/http/factory_spec.rb +22 -0
  262. data/spec/unit/network/http/webrick_spec.rb +30 -29
  263. data/spec/unit/node/environment_spec.rb +16 -0
  264. data/spec/unit/node_spec.rb +102 -16
  265. data/spec/unit/parser/environment_compiler_spec.rb +1 -1
  266. data/spec/unit/parser/functions/sprintf_spec.rb +26 -0
  267. data/spec/unit/parser/resource/param_spec.rb +1 -1
  268. data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +9 -9
  269. data/spec/unit/pops/loaders/static_loader_spec.rb +1 -1
  270. data/spec/unit/pops/parser/parse_containers_spec.rb +1 -1
  271. data/spec/unit/pops/types/type_calculator_spec.rb +40 -0
  272. data/spec/unit/pops/types/type_mismatch_describer_spec.rb +9 -0
  273. data/spec/unit/provider/selmodule_spec.rb +6 -0
  274. data/spec/unit/provider/service/init_spec.rb +1 -1
  275. data/spec/unit/provider/service/smf_spec.rb +2 -0
  276. data/spec/unit/provider/service/systemd_spec.rb +14 -0
  277. data/spec/unit/resource/catalog_spec.rb +12 -2
  278. data/spec/unit/settings/config_file_spec.rb +1 -1
  279. data/spec/unit/transaction/persistence_spec.rb +42 -0
  280. data/spec/unit/transaction/report_spec.rb +19 -4
  281. data/spec/unit/transaction_spec.rb +27 -0
  282. data/spec/unit/type/schedule_spec.rb +14 -0
  283. data/spec/unit/type_spec.rb +3 -3
  284. data/spec/unit/util/errors_spec.rb +1 -1
  285. data/spec/unit/util/http_proxy_spec.rb +37 -0
  286. data/spec/unit/util/log_spec.rb +3 -3
  287. data/spec/unit/util/logging_spec.rb +7 -7
  288. data/spec/unit/util/monkey_patches_spec.rb +6 -2
  289. metadata +3433 -3416
  290. checksums.yaml +0 -7
  291. data/spec/unit/gettext_config_spec.rb +0 -57
@@ -79,7 +79,7 @@ class Puppet::Daemon
79
79
  end
80
80
 
81
81
  def reexec
82
- raise Puppet::DevError, "Cannot reexec unless ARGV arguments are set" unless argv
82
+ raise Puppet::DevError, _("Cannot reexec unless ARGV arguments are set") unless argv
83
83
  command = $0 + " " + argv.join(" ")
84
84
  Puppet.notice "Restarting with '#{command}'"
85
85
  stop(:exit => false)
@@ -140,7 +140,7 @@ class Puppet::Daemon
140
140
  def start
141
141
  create_pidfile
142
142
 
143
- raise Puppet::DevError, "Daemons must have an agent, server, or both" unless agent or server
143
+ raise Puppet::DevError, _("Daemons must have an agent, server, or both") unless agent or server
144
144
 
145
145
  # Start the listening server, if required.
146
146
  server.start if server
@@ -99,7 +99,8 @@ module Puppet
99
99
  valid = %w[deprecations undefined_variables undefined_resources]
100
100
  invalid = values - (values & valid)
101
101
  if not invalid.empty?
102
- raise ArgumentError, "Cannot disable unrecognized warning types #{invalid.inspect}. Valid values are #{valid.inspect}."
102
+ raise ArgumentError, _("Cannot disable unrecognized warning types %{invalid}.") % { invalid: invalid.inspect } +
103
+ ' ' + _("Valid values are %{values}.") % { values: valid.inspect}
103
104
  end
104
105
  end
105
106
  },
@@ -166,6 +167,13 @@ module Puppet
166
167
  :type => :boolean,
167
168
  :desc => "Whether to enable experimental performance profiling",
168
169
  },
170
+ :future_features => {
171
+ :default => false,
172
+ :type => :boolean,
173
+ :desc => "Whether or not to enable all features currently being developed for future
174
+ major releases of Puppet. Should be used with caution, as in development
175
+ features are experimental and can have unexpected effects."
176
+ },
169
177
  :static_catalogs => {
170
178
  :default => true,
171
179
  :type => :boolean,
@@ -289,10 +297,26 @@ module Puppet
289
297
  },
290
298
  :environment => {
291
299
  :default => "production",
292
- :desc => "The environment Puppet is running in. For clients
293
- (e.g., `puppet agent`) this determines the environment itself, which
294
- is used to find modules and much more. For servers (i.e., `puppet master`)
295
- this provides the default environment for nodes we know nothing about."
300
+ :desc => "The environment in which Puppet is running. For clients,
301
+ such as `puppet agent`, this determines the environment itself, which
302
+ Puppet uses to find modules and much more. For servers, such as `puppet master`,
303
+ this provides the default environment for nodes that Puppet knows nothing about.
304
+
305
+ When defining an environment in the `[agent]` section, this refers to the
306
+ environment that the agent requests from the master. The environment doesn't
307
+ have to exist on the local filesystem because the agent fetches it from the
308
+ master. This definition is used when running `puppet agent`.
309
+
310
+ When defined in the `[user]` section, the environment refers to the path that
311
+ Puppet uses to search for code and modules related to its execution. This
312
+ requires the environment to exist locally on the filesystem where puppet is
313
+ being executed. Puppet subcommands, including `puppet module` and
314
+ `puppet apply`, use this definition.
315
+
316
+ Given that the context and effects vary depending on the
317
+ [config section](https://puppet.com/docs/puppet/latest/config_file_main.html#config-sections)
318
+ in which the `environment` setting is defined, do not set it globally.",
319
+ :short => "E"
296
320
  },
297
321
  :environmentpath => {
298
322
  :default => "$codedir/environments",
@@ -418,7 +442,11 @@ module Puppet
418
442
  if Puppet[:strict] != :off
419
443
  s_val = value.to_s # because sometimes the value is a symbol
420
444
  unless s_val == 'hiera' || s_val == 'none' || value == '' || value.nil?
421
- Puppet.deprecation_warning "Setting 'data_binding_terminus' is deprecated. Convert custom terminus to hiera 5 API."
445
+ #TRANSLATORS 'data_binding_terminus' is a setting and should not be translated
446
+ message = _("Setting 'data_binding_terminus' is deprecated.")
447
+ #TRANSLATORS 'hiera' should not be translated
448
+ message += ' ' + _("Convert custom terminus to hiera 5 API.")
449
+ Puppet.deprecation_warning(message)
422
450
  end
423
451
  end
424
452
  end
@@ -570,7 +598,8 @@ module Puppet
570
598
  custom data providers see the respective module documentation. This setting is deprecated.",
571
599
  :hook => proc { |value|
572
600
  unless value.nil? || Puppet[:strict] == :off
573
- Puppet.deprecation_warning "Setting 'environment_data_provider' is deprecated."
601
+ #TRANSLATORS 'environment_data_provider' is a setting and should not be translated
602
+ Puppet.deprecation_warning(_("Setting 'environment_data_provider' is deprecated."))
574
603
  end
575
604
  }
576
605
  },
@@ -672,7 +701,7 @@ module Puppet
672
701
  for a normal node.
673
702
 
674
703
  Defaults to the node's fully qualified domain name.",
675
- :hook => proc { |value| raise(ArgumentError, "Certificate names must be lower case") unless value == value.downcase }},
704
+ :hook => proc { |value| raise(ArgumentError, _("Certificate names must be lower case")) unless value == value.downcase }},
676
705
  :dns_alt_names => {
677
706
  :default => '',
678
707
  :desc => <<EOT,
@@ -907,7 +936,8 @@ EOT
907
936
  valid = ['md5', 'md5lite', 'sha256', 'sha256lite', 'sha1', 'sha1lite', 'mtime', 'ctime']
908
937
  invalid = values.reject {|alg| valid.include?(alg)}
909
938
  if not invalid.empty?
910
- raise ArgumentError, "Unrecognized checksum types #{invalid} are not supported. Valid values are #{valid}."
939
+ raise ArgumentError, _("Unrecognized checksum types %{invalid} are not supported.") % { invalid: invalid } +
940
+ ' ' + _("Valid values are %{values}.") % { values: valid }
911
941
  end
912
942
  end
913
943
  }
@@ -1075,6 +1105,10 @@ EOT
1075
1105
  and monitoring systems to determine if a puppet process is still in
1076
1106
  the process table.",
1077
1107
  },
1108
+ :sourceaddress => {
1109
+ :default => nil,
1110
+ :desc => "The address the agent should use to initiate requests.",
1111
+ },
1078
1112
  :bindaddress => {
1079
1113
  :default => "*",
1080
1114
  :desc => "The address a listening server should bind to.",
@@ -1325,6 +1359,8 @@ EOT
1325
1359
  :default => "$vardir/devices",
1326
1360
  :type => :directory,
1327
1361
  :mode => "0750",
1362
+ :owner => "service",
1363
+ :group => "service",
1328
1364
  :desc => "The root directory of devices' $vardir.",
1329
1365
  },
1330
1366
  :deviceconfig => {
@@ -1424,7 +1460,10 @@ EOT
1424
1460
  :call_hook => :on_initialize_and_write,
1425
1461
  :hook => proc { |value|
1426
1462
  if Puppet.settings.set_by_config?(:server) && Puppet.settings.set_by_config?(:server_list)
1427
- Puppet.deprecation_warning('Attempted to set both server and server_list. Server setting will not be used.', :SERVER_DUPLICATION)
1463
+ #TRANSLATOR 'server' and 'server_list' are setting names and should not be translated
1464
+ message = _('Attempted to set both server and server_list.')
1465
+ message += ' ' + _('Server setting will not be used.')
1466
+ Puppet.deprecation_warning(message, :SERVER_DUPLICATION)
1428
1467
  end
1429
1468
  }
1430
1469
  },
@@ -1436,7 +1475,10 @@ EOT
1436
1475
  :call_hook => :on_initialize_and_write,
1437
1476
  :hook => proc { |value|
1438
1477
  if Puppet.settings.set_by_config?(:server) && Puppet.settings.set_by_config?(:server_list)
1439
- Puppet.deprecation_warning('Attempted to set both server and server_list. Server setting will not be used.', :SERVER_DUPLICATION)
1478
+ #TRANSLATOR 'server' and 'server_list' are setting names and should not be translated
1479
+ message = _('Attempted to set both server and server_list.')
1480
+ message += ' ' + _('Server setting will not be used.')
1481
+ Puppet.deprecation_warning(message, :SERVER_DUPLICATION)
1440
1482
  end
1441
1483
  }
1442
1484
  },
@@ -1494,6 +1536,13 @@ EOT
1494
1536
  \"never run.\" If you want puppet agent to never run, you should start
1495
1537
  it with the `--no-client` option. #{AS_DURATION}",
1496
1538
  },
1539
+ :runtimeout => {
1540
+ :default => 0,
1541
+ :type => :duration,
1542
+ :desc => "The maximum amount of time an agent run is allowed to take.
1543
+ A Puppet agent run that exceeds this timeout will be aborted.
1544
+ Defaults to 0, which is unlimited. #{AS_DURATION}",
1545
+ },
1497
1546
  :ca_server => {
1498
1547
  :default => "$server",
1499
1548
  :desc => "The server to use for certificate
@@ -1555,23 +1604,33 @@ EOT
1555
1604
  :splaylimit => {
1556
1605
  :default => "$runinterval",
1557
1606
  :type => :duration,
1558
- :desc => "The maximum time to delay before runs. Defaults to being the same as the
1559
- run interval. #{AS_DURATION}",
1607
+ :desc => "The maximum time to delay before an agent's first run when
1608
+ `splay` is enabled. Defaults to the agent's `$runinterval`. The
1609
+ `splay` interval is random and recalculated each time the agent is started or
1610
+ restarted. #{AS_DURATION}",
1560
1611
  },
1561
1612
  :splay => {
1562
1613
  :default => false,
1563
1614
  :type => :boolean,
1564
- :desc => "Whether to sleep for a pseudo-random (but consistent) amount of time before
1565
- a run.
1566
-
1567
- For example, without `splay` enabled, your agent checks in every 30
1568
- minutes at :01 and :31 past the hour. After enabling `splay`, the agent
1569
- will wait the pseudorandom sleep time, say eight minutes, and then check
1570
- in every 30 minutes, at :09 and :39 after the hour. If you restart the
1571
- same agent at 12:45 PM, it will wait its eight minutes, and check in at
1572
- 12:52 PM, and every 30 minutes after that, at 1:22 PM, 1:52 PM, and so
1573
- on. Other agents will have different sleep times, and so will check in
1574
- at different times even if they are all restarted at the same time.",
1615
+ :desc => "Whether to sleep for a random amount of time, ranging from
1616
+ immediately up to its `$splaylimit`, before performing its first agent run
1617
+ after a service restart. After this period, the agent runs periodically
1618
+ on its `$runinterval`.
1619
+
1620
+ For example, assume a default 30-minute `$runinterval`, `splay` set to its
1621
+ default of `false`, and an agent starting at :00 past the hour. The agent
1622
+ would check in every 30 minutes at :01 and :31 past the hour.
1623
+
1624
+ With `splay` enabled, it waits any amount of time up to its `$splaylimit`
1625
+ before its first run. For example, it might randomly wait 8 minutes,
1626
+ then start its first run at :08 past the hour. With the `$runinterval`
1627
+ at its default 30 minutes, its next run will be at :38 past the hour.
1628
+
1629
+ If you restart an agent's puppet service with `splay` enabled, it
1630
+ recalculates its splay period and delays its first agent run after
1631
+ restarting for this new period. If you simultaneously restart a group of
1632
+ puppet agents with `splay` enabled, their checkins to your puppet masters
1633
+ can be distributed more evenly.",
1575
1634
  },
1576
1635
  :clientbucketdir => {
1577
1636
  :default => "$vardir/clientbucket",
@@ -1708,18 +1767,31 @@ EOT
1708
1767
  :default => "puppet:///pluginfacts",
1709
1768
  :desc => "Where to retrieve external facts for pluginsync",
1710
1769
  },
1770
+ :localedest => {
1771
+ :type => :directory,
1772
+ :default => "$vardir/locales",
1773
+ :desc => "Where Puppet should store translation files that it pulls down from the central
1774
+ server.",
1775
+ },
1776
+ :localesource => {
1777
+ :default => "puppet:///locales",
1778
+ :desc => "From where to retrieve translation files. The standard Puppet `file` type
1779
+ is used for retrieval, so anything that is a valid file source can
1780
+ be used here.",
1781
+ },
1782
+
1711
1783
  :pluginsync => {
1712
1784
  :default => true,
1713
1785
  :type => :boolean,
1714
1786
  :desc => "Whether plugins should be synced with the central server. This setting is
1715
1787
  deprecated.",
1716
1788
  :hook => proc { |value|
1717
- Puppet.deprecation_warning "Setting 'pluginsync' is deprecated."
1789
+ #TRANSLATORS 'pluginsync' is a setting and should not be translated
1790
+ Puppet.deprecation_warning(_("Setting 'pluginsync' is deprecated."))
1718
1791
  }
1719
1792
  },
1720
-
1721
1793
  :pluginsignore => {
1722
- :default => ".svn CVS .git .hg",
1794
+ :default => ".svn CVS .git .hg *.pot",
1723
1795
  :desc => "What files to ignore when pulling down plugins.",
1724
1796
  }
1725
1797
  )
@@ -365,6 +365,7 @@ module Puppet::Environments
365
365
  # (The intention is that this could be used from a MANUAL cache eviction command (TBD)
366
366
  def clear(name)
367
367
  @cache.delete(name)
368
+ Puppet::GettextConfig.delete_text_domain(name)
368
369
  end
369
370
 
370
371
  # Clears all cached environments.
@@ -374,6 +375,7 @@ module Puppet::Environments
374
375
  @cache = {}
375
376
  @expirations.clear
376
377
  @next_expiration = END_OF_TIME
378
+ Puppet::GettextConfig.delete_environment_text_domains
377
379
  end
378
380
 
379
381
  # Clears all environments that have expired, either by exceeding their time to live, or
@@ -27,22 +27,12 @@ module Puppet
27
27
  @line = line
28
28
  @pos = pos
29
29
  end
30
+
30
31
  def to_s
31
32
  msg = super
32
33
  @file = nil if (@file.is_a?(String) && @file.empty?)
33
- if @file and @line and @pos
34
- "#{msg} at #{@file}:#{@line}:#{@pos}"
35
- elsif @file and @line
36
- "#{msg} at #{@file}:#{@line}"
37
- elsif @line and @pos
38
- "#{msg} at line #{@line}:#{@pos}"
39
- elsif @line
40
- "#{msg} at line #{@line}"
41
- elsif @file
42
- "#{msg} in #{@file}"
43
- else
44
- msg
45
- end
34
+ msg += Puppet::Util::Errors.error_location_with_space(@file, @line, @pos)
35
+ msg
46
36
  end
47
37
  end
48
38
 
@@ -74,8 +64,8 @@ module Puppet
74
64
 
75
65
  def to_s
76
66
  msg = super
77
- msg = "Could not parse for environment #{environment}: #{msg}" if environment
78
- msg = "#{msg} on node #{node}" if node
67
+ msg = _("Could not parse for environment %{environment}: %{message}") % { environment: environment, message: msg } if environment
68
+ msg = _("%{message} on node %{node}") % { message: msg, node: node } if node
79
69
  msg
80
70
  end
81
71
  end
@@ -43,7 +43,7 @@ module PSON
43
43
  case
44
44
  when c.empty? then p
45
45
  when p.const_defined?(c) then p.const_get(c)
46
- else raise ArgumentError, "can't find const for unregistered document type #{path}"
46
+ else raise ArgumentError, _("can't find const for unregistered document type %{path}") % { path: path}
47
47
  end
48
48
  end
49
49
  end
@@ -308,7 +308,7 @@ module PSON
308
308
  result
309
309
  end
310
310
  rescue PSON::NestingError
311
- raise ArgumentError, "exceed depth limit", $!.backtrace
311
+ raise ArgumentError, _("exceed depth limit"), $!.backtrace
312
312
  end
313
313
 
314
314
 
@@ -71,7 +71,7 @@ Puppet::Indirector::Face.define(:catalog, '0.0.1') do
71
71
  Puppet::Util::Log.newdestination(report)
72
72
 
73
73
  begin
74
- benchmark(:notice, "Finished catalog run") do
74
+ benchmark(:notice, "Finished catalog run in %{seconds} seconds") do
75
75
  catalog.apply(:report => report)
76
76
  end
77
77
  rescue => detail
@@ -75,7 +75,7 @@ Puppet::Face.define(:config, '0.0.1') do
75
75
  if args.length == 1
76
76
  puts values.interpolate(args[0].to_sym)
77
77
  else
78
- args.each do |setting_name|
78
+ args.sort.each do |setting_name|
79
79
  puts "#{setting_name} = #{values.interpolate(setting_name.to_sym)}"
80
80
  end
81
81
  end
@@ -106,6 +106,19 @@ Puppet::Face.define(:config, '0.0.1') do
106
106
  EOT
107
107
 
108
108
  when_invoked do |name, value, options|
109
+ if name == 'environment' && options[:section] == 'main'
110
+ Puppet.warning _(<<-EOM).chomp
111
+ The environment should be set in either the `[user]`, `[agent]`, or `[master]`
112
+ section. Variables set in the `[agent]` section are used when running
113
+ `puppet agent`. Variables set in the `[user]` section are used when running
114
+ various other puppet subcommands, like `puppet apply` and `puppet module`; these
115
+ require the defined environment directory to exist locally. Set the config
116
+ section by using the `--section` flag. For example,
117
+ `puppet config --section user set environment foo`. For more information, see
118
+ https://puppet.com/docs/puppet/latest/configuration.html#environment
119
+ EOM
120
+ end
121
+
109
122
  path = Puppet::FileSystem.pathname(Puppet.settings.which_configuration_file)
110
123
  Puppet::FileSystem.touch(path)
111
124
  Puppet::FileSystem.open(path, nil, 'r+:UTF-8') do |file|
@@ -92,7 +92,8 @@ Puppet::Face.define(:epp, '0.0.1') do
92
92
  end
93
93
  end
94
94
  if !missing_files.empty?
95
- raise Puppet::Error, _("One or more file(s) specified did not exist:\n") + missing_files.map { |f| " #{f}" }.join("\n")
95
+ raise Puppet::Error, _("One or more file(s) specified did not exist:\n%{missing_files_list}") %
96
+ { missing_files_list: missing_files.map { |f| " #{f}" }.join("\n") }
96
97
  else
97
98
  # Exit with 1 if there were errors
98
99
  raise Puppet::Error, _("Errors while validating epp") unless status
@@ -180,7 +181,8 @@ Puppet::Face.define(:epp, '0.0.1') do
180
181
  end
181
182
 
182
183
  if !missing_files.empty?
183
- raise Puppet::Error, _("One or more file(s) specified did not exist:\n") + missing_files.collect { |f| " #{f}" }.join("\n")
184
+ raise Puppet::Error, _("One or more file(s) specified did not exist:\n%{missing_files_list}") %
185
+ { missing_files_list: missing_files.collect { |f| " #{f}" }.join("\n") }
184
186
  end
185
187
  end
186
188
  buffer.string
@@ -78,26 +78,24 @@ Puppet::Face.define(:help, '0.0.1') do
78
78
  def render_application_help(applicationname)
79
79
  return Puppet::Application[applicationname].help
80
80
  rescue StandardError, LoadError => detail
81
- msg = _(<<-MSG) % { applicationname: applicationname, detail: detail.message }
82
- Could not load help for the application %{applicationname}.
83
- Please check the error logs for more information.
84
-
85
- Detail: "%{detail}"
86
- MSG
87
- fail ArgumentError, msg, detail.backtrace
81
+ message = []
82
+ message << _('Could not load help for the application %{application_name}.') % { application_name: applicationname }
83
+ message << _('Please check the error logs for more information.')
84
+ message << ''
85
+ message << _('Detail: "%{detail}"') % { detail: detail.message }
86
+ fail ArgumentError, message.join("\n"), detail.backtrace
88
87
  end
89
88
 
90
89
  def render_face_help(facename, actionname, version)
91
90
  face, action = load_face_help(facename, actionname, version)
92
91
  return template_for(face, action).result(binding)
93
92
  rescue StandardError, LoadError => detail
94
- msg = _(<<-MSG) % { facename: facename, detail: detail.message }
95
- Could not load help for the face %{facename}.
96
- Please check the error logs for more information.
97
-
98
- Detail: "%{detail}"
99
- MSG
100
- fail ArgumentError, msg, detail.backtrace
93
+ message = []
94
+ message << _('Could not load help for the face %{face_name}.') % { face_name: facename }
95
+ message << _('Please check the error logs for more information.')
96
+ message << ''
97
+ message << _('Detail: "%{detail}"') % { detail: detail.message }
98
+ fail ArgumentError, message.join("\n"), detail.backtrace
101
99
  end
102
100
 
103
101
  def load_face_help(facename, actionname, version)
@@ -25,6 +25,7 @@ Puppet::Face.define(:man, '0.0.1') do
25
25
  action(:man) do
26
26
  summary _("Display the manual page for a Puppet subcommand.")
27
27
  arguments _("<subcommand>")
28
+ #TRANSLATORS '--render-as s' is a command line option and should not be translated
28
29
  returns _(<<-'EOT')
29
30
  The man data, in Markdown format, suitable for consumption by Ronn.
30
31
 
@@ -57,7 +57,7 @@ Puppet::Face.define(:module, '1.0.0') do
57
57
 
58
58
  when_rendering :console do |return_value|
59
59
  # Get the string representation of the Pathname object.
60
- _("Module built: ") + return_value.expand_path.to_s
60
+ _("Module built: %{path}") % { path: return_value.expand_path.to_s }
61
61
  end
62
62
  end
63
63
  end
@@ -109,20 +109,10 @@ Puppet::Face.define(:module, '1.0.0') do
109
109
  end
110
110
 
111
111
  def warn_unmet_dependencies(environment)
112
- error_types = {
113
- :non_semantic_version => {
114
- :title => _("Non semantic version dependency")
115
- },
116
- :missing => {
117
- :title => _("Missing dependency")
118
- },
119
- :version_mismatch => {
120
- :title => _("Module '%s' (v%s) fails to meet some dependencies:")
121
- }
122
- }
112
+ error_types = [:non_semantic_version, :version_mismatch, :missing]
123
113
 
124
114
  @unmet_deps = {}
125
- error_types.each_key do |type|
115
+ error_types.each do |type|
126
116
  @unmet_deps[type] = Hash.new do |hash, key|
127
117
  hash[key] = { :errors => [], :parent => nil }
128
118
  end
@@ -160,19 +150,18 @@ Puppet::Face.define(:module, '1.0.0') do
160
150
  error_display_order = [:non_semantic_version, :version_mismatch, :missing]
161
151
  error_display_order.each do |type|
162
152
  unless @unmet_deps[type].empty?
163
- @unmet_deps[type].keys.sort_by {|dep| dep }.each do |dep|
153
+ @unmet_deps[type].keys.sort.each do |dep|
164
154
  name = dep.gsub('/', '-')
165
- title = error_types[type][:title]
166
155
  errors = @unmet_deps[type][dep][:errors]
167
156
  version = @unmet_deps[type][dep][:version]
168
157
 
169
158
  msg = case type
170
159
  when :version_mismatch
171
- title % [name, version] + "\n"
160
+ _("Module '%{name}' (v%{version}) fails to meet some dependencies:\n") % { name: name, version: version }
172
161
  when :non_semantic_version
173
- title + " '#{name}' (v#{version}):\n"
162
+ _("Non semantic version dependency %{name} (v%{version}):\n") % { name: name, version: version }
174
163
  else
175
- title + " '#{name}':\n"
164
+ _("Missing dependency '%{name}':\n") % { name: name }
176
165
  end
177
166
 
178
167
  errors.each { |error_string| msg << " #{error_string}\n" }