puppet 5.3.3-universal-darwin → 5.3.4-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.
- data/CONTRIBUTING.md +1 -1
- data/Gemfile +3 -0
- data/ext/puppet-test +3 -2
- data/lib/hiera/puppet_function.rb +5 -2
- data/lib/hiera_puppet.rb +3 -3
- data/lib/puppet.rb +2 -5
- data/lib/puppet/agent.rb +22 -2
- data/lib/puppet/agent/locker.rb +6 -5
- data/lib/puppet/application.rb +18 -1
- data/lib/puppet/application/agent.rb +9 -2
- data/lib/puppet/application/apply.rb +1 -1
- data/lib/puppet/application/config.rb +1 -0
- data/lib/puppet/application/device.rb +1 -2
- data/lib/puppet/application/filebucket.rb +22 -5
- data/lib/puppet/application/help.rb +1 -0
- data/lib/puppet/application/lookup.rb +1 -3
- data/lib/puppet/application_support.rb +6 -1
- data/lib/puppet/bindings.rb +2 -1
- data/lib/puppet/configurer.rb +9 -4
- data/lib/puppet/configurer/downloader_factory.rb +10 -0
- data/lib/puppet/configurer/plugin_handler.rb +11 -4
- data/lib/puppet/daemon.rb +2 -2
- data/lib/puppet/defaults.rb +99 -27
- data/lib/puppet/environments.rb +2 -0
- data/lib/puppet/error.rb +5 -15
- data/lib/puppet/external/pson/common.rb +2 -2
- data/lib/puppet/face/catalog.rb +1 -1
- data/lib/puppet/face/config.rb +14 -1
- data/lib/puppet/face/epp.rb +4 -2
- data/lib/puppet/face/help.rb +12 -14
- data/lib/puppet/face/man.rb +1 -0
- data/lib/puppet/face/module/build.rb +1 -1
- data/lib/puppet/face/module/list.rb +6 -17
- data/lib/puppet/face/module/uninstall.rb +14 -3
- data/lib/puppet/face/node.rb +1 -0
- data/lib/puppet/face/status.rb +1 -0
- data/lib/puppet/file_serving/base.rb +2 -1
- data/lib/puppet/file_serving/configuration.rb +3 -0
- data/lib/puppet/file_serving/configuration/parser.rb +23 -9
- data/lib/puppet/file_serving/mount/locales.rb +35 -0
- data/lib/puppet/forge.rb +2 -1
- data/lib/puppet/forge/errors.rb +24 -22
- data/lib/puppet/functions/binary_file.rb +1 -0
- data/lib/puppet/functions/each.rb +10 -4
- data/lib/puppet/functions/eyaml_lookup_key.rb +4 -2
- data/lib/puppet/functions/lookup.rb +2 -2
- data/lib/puppet/functions/map.rb +12 -2
- data/lib/puppet/functions/slice.rb +2 -3
- data/lib/puppet/functions/unique.rb +1 -1
- data/lib/puppet/functions/yaml_data.rb +1 -1
- data/lib/puppet/gettext/config.rb +144 -41
- data/lib/puppet/gettext/module_translations.rb +42 -0
- data/lib/puppet/graph/relationship_graph.rb +1 -1
- data/lib/puppet/graph/simple_graph.rb +3 -3
- data/lib/puppet/indirector/catalog/compiler.rb +40 -25
- data/lib/puppet/indirector/exec.rb +1 -1
- data/lib/puppet/indirector/facts/facter.rb +3 -3
- data/lib/puppet/indirector/facts/network_device.rb +2 -2
- data/lib/puppet/indirector/file_bucket_file/file.rb +4 -1
- data/lib/puppet/indirector/indirection.rb +17 -9
- data/lib/puppet/indirector/ldap.rb +2 -2
- data/lib/puppet/indirector/node/write_only_yaml.rb +3 -1
- data/lib/puppet/indirector/rest.rb +8 -5
- data/lib/puppet/indirector/ssl_file.rb +2 -2
- data/lib/puppet/indirector/terminus.rb +3 -3
- data/lib/puppet/interface.rb +2 -1
- data/lib/puppet/interface/action.rb +41 -24
- data/lib/puppet/interface/action_builder.rb +14 -5
- data/lib/puppet/interface/action_manager.rb +1 -1
- data/lib/puppet/interface/documentation.rb +21 -10
- data/lib/puppet/interface/face_collection.rb +4 -2
- data/lib/puppet/interface/option.rb +36 -15
- data/lib/puppet/interface/option_builder.rb +23 -9
- data/lib/puppet/interface/option_manager.rb +8 -3
- data/lib/puppet/metatype/manager.rb +7 -3
- data/lib/puppet/module.rb +18 -21
- data/lib/puppet/module_tool/errors/installer.rb +18 -20
- data/lib/puppet/module_tool/errors/shared.rb +20 -15
- data/lib/puppet/module_tool/errors/uninstaller.rb +1 -0
- data/lib/puppet/module_tool/errors/upgrader.rb +1 -1
- data/lib/puppet/module_tool/tar/mini.rb +57 -4
- data/lib/puppet/network/auth_config_parser.rb +18 -13
- data/lib/puppet/network/authstore.rb +2 -2
- data/lib/puppet/network/client_request.rb +1 -1
- data/lib/puppet/network/format.rb +3 -3
- data/lib/puppet/network/http/api/indirection_type.rb +1 -1
- data/lib/puppet/network/http/api/master/v3/environment.rb +5 -2
- data/lib/puppet/network/http/error.rb +7 -7
- data/lib/puppet/network/http/factory.rb +9 -0
- data/lib/puppet/network/http/rack.rb +2 -2
- data/lib/puppet/network/http/webrick.rb +2 -4
- data/lib/puppet/node.rb +25 -6
- data/lib/puppet/node/environment.rb +14 -0
- data/lib/puppet/node/facts.rb +9 -0
- data/lib/puppet/parameter.rb +3 -3
- data/lib/puppet/parameter/value_collection.rb +9 -9
- data/lib/puppet/parser/ast/leaf.rb +1 -1
- data/lib/puppet/parser/ast/node.rb +2 -2
- data/lib/puppet/parser/ast/pops_bridge.rb +1 -1
- data/lib/puppet/parser/compiler.rb +6 -5
- data/lib/puppet/parser/functions.rb +1 -1
- data/lib/puppet/parser/functions/generate.rb +2 -4
- data/lib/puppet/parser/functions/inline_template.rb +1 -2
- data/lib/puppet/parser/functions/sprintf.rb +17 -3
- data/lib/puppet/parser/functions/template.rb +6 -2
- data/lib/puppet/parser/resource.rb +30 -31
- data/lib/puppet/parser/scope.rb +20 -11
- data/lib/puppet/parser/templatewrapper.rb +4 -3
- data/lib/puppet/pops/evaluator/collector_transformer.rb +2 -1
- data/lib/puppet/pops/evaluator/collectors/abstract_collector.rb +1 -1
- data/lib/puppet/pops/evaluator/epp_evaluator.rb +21 -8
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +2 -1
- data/lib/puppet/pops/evaluator/external_syntax_support.rb +1 -1
- data/lib/puppet/pops/evaluator/runtime3_converter.rb +3 -1
- data/lib/puppet/pops/evaluator/runtime3_resource_support.rb +1 -1
- data/lib/puppet/pops/evaluator/runtime3_support.rb +4 -4
- data/lib/puppet/pops/functions/dispatch.rb +1 -1
- data/lib/puppet/pops/functions/function.rb +8 -2
- data/lib/puppet/pops/issue_reporter.rb +7 -2
- data/lib/puppet/pops/issues.rb +10 -4
- data/lib/puppet/pops/label_provider.rb +1 -1
- data/lib/puppet/pops/loader/module_loaders.rb +5 -2
- data/lib/puppet/pops/loader/static_loader.rb +1 -1
- data/lib/puppet/pops/loaders.rb +7 -3
- data/lib/puppet/pops/lookup/explainer.rb +2 -1
- data/lib/puppet/pops/lookup/hiera_config.rb +2 -2
- data/lib/puppet/pops/lookup/lookup_adapter.rb +4 -4
- data/lib/puppet/pops/merge_strategy.rb +6 -3
- data/lib/puppet/pops/migration/migration_checker.rb +8 -8
- data/lib/puppet/pops/model/ast_transformer.rb +1 -1
- data/lib/puppet/pops/model/factory.rb +4 -2
- data/lib/puppet/pops/resource/resource_type_impl.rb +1 -1
- data/lib/puppet/pops/serialization/abstract_writer.rb +2 -1
- data/lib/puppet/pops/types/iterable.rb +2 -0
- data/lib/puppet/pops/types/p_object_type.rb +36 -15
- data/lib/puppet/pops/types/type_calculator.rb +2 -1
- data/lib/puppet/pops/types/type_factory.rb +3 -1
- data/lib/puppet/pops/types/type_mismatch_describer.rb +19 -6
- data/lib/puppet/pops/types/type_parser.rb +7 -7
- data/lib/puppet/pops/types/types.rb +10 -4
- data/lib/puppet/pops/validation.rb +14 -12
- data/lib/puppet/property.rb +14 -6
- data/lib/puppet/property/ensure.rb +2 -2
- data/lib/puppet/provider.rb +4 -4
- data/lib/puppet/provider/group/aix.rb +4 -2
- data/lib/puppet/provider/ldap.rb +2 -2
- data/lib/puppet/provider/naginator.rb +1 -1
- data/lib/puppet/provider/nameservice.rb +7 -4
- data/lib/puppet/provider/nameservice/directoryservice.rb +4 -3
- data/lib/puppet/provider/package/aix.rb +1 -1
- data/lib/puppet/provider/package/nim.rb +7 -8
- data/lib/puppet/provider/package/opkg.rb +1 -1
- data/lib/puppet/provider/package/pkg.rb +9 -6
- data/lib/puppet/provider/package/pkgutil.rb +3 -3
- data/lib/puppet/provider/package/yum.rb +1 -1
- data/lib/puppet/provider/parsedfile.rb +4 -4
- data/lib/puppet/provider/selmodule/semodule.rb +5 -3
- data/lib/puppet/provider/service/base.rb +1 -1
- data/lib/puppet/provider/service/init.rb +1 -1
- data/lib/puppet/provider/service/launchd.rb +2 -2
- data/lib/puppet/provider/service/runit.rb +2 -1
- data/lib/puppet/provider/service/smf.rb +2 -0
- data/lib/puppet/provider/service/systemd.rb +1 -0
- data/lib/puppet/provider/service/upstart.rb +1 -1
- data/lib/puppet/provider/user/aix.rb +13 -6
- data/lib/puppet/provider/user/openbsd.rb +2 -1
- data/lib/puppet/provider/yumrepo/inifile.rb +2 -1
- data/lib/puppet/provider/zone/solaris.rb +2 -2
- data/lib/puppet/reference/configuration.rb +4 -2
- data/lib/puppet/relationship.rb +2 -1
- data/lib/puppet/reports/store.rb +1 -1
- data/lib/puppet/resource.rb +7 -5
- data/lib/puppet/resource/capability_finder.rb +14 -11
- data/lib/puppet/resource/catalog.rb +33 -18
- data/lib/puppet/resource/type.rb +5 -5
- data/lib/puppet/settings.rb +19 -13
- data/lib/puppet/settings/base_setting.rb +23 -8
- data/lib/puppet/settings/config_file.rb +14 -4
- data/lib/puppet/settings/environment_conf.rb +19 -9
- data/lib/puppet/ssl/base.rb +9 -4
- data/lib/puppet/ssl/oids.rb +8 -2
- data/lib/puppet/syntax_checkers/base64.rb +5 -6
- data/lib/puppet/transaction.rb +7 -3
- data/lib/puppet/transaction/persistence.rb +16 -1
- data/lib/puppet/transaction/report.rb +6 -0
- data/lib/puppet/type.rb +27 -35
- data/lib/puppet/type/file.rb +2 -1
- data/lib/puppet/type/file/data_sync.rb +2 -1
- data/lib/puppet/type/file/source.rb +1 -1
- data/lib/puppet/type/group.rb +1 -1
- data/lib/puppet/type/mount.rb +1 -1
- data/lib/puppet/type/resources.rb +1 -1
- data/lib/puppet/type/schedule.rb +26 -14
- data/lib/puppet/type/user.rb +9 -3
- data/lib/puppet/type/zone.rb +1 -1
- data/lib/puppet/util.rb +27 -21
- data/lib/puppet/util/at_fork/solaris.rb +6 -4
- data/lib/puppet/util/command_line.rb +5 -0
- data/lib/puppet/util/command_line/trollop.rb +6 -5
- data/lib/puppet/util/errors.rb +61 -8
- data/lib/puppet/util/fileparsing.rb +3 -5
- data/lib/puppet/util/http_proxy.rb +14 -6
- data/lib/puppet/util/instance_loader.rb +1 -3
- data/lib/puppet/util/ldap/manager.rb +6 -3
- data/lib/puppet/util/log.rb +19 -24
- data/lib/puppet/util/logging.rb +21 -28
- data/lib/puppet/util/methodhelper.rb +1 -1
- data/lib/puppet/util/nagios_maker.rb +1 -1
- data/lib/puppet/util/network_device/config.rb +21 -13
- data/lib/puppet/util/plist.rb +3 -1
- data/lib/puppet/util/posix.rb +1 -1
- data/lib/puppet/util/provider_features.rb +1 -1
- data/lib/puppet/util/rdoc/generators/puppet_generator.rb +1 -1
- data/lib/puppet/util/reference.rb +2 -3
- data/lib/puppet/util/selinux.rb +1 -1
- data/lib/puppet/util/storage.rb +2 -2
- data/lib/puppet/util/windows/eventlog.rb +10 -5
- data/lib/puppet/util/windows/file.rb +61 -9
- data/lib/puppet/util/windows/process.rb +1 -1
- data/lib/puppet/util/windows/taskscheduler.rb +2 -2
- data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet.rb +5 -1
- data/lib/puppet/version.rb +1 -1
- data/locales/en/puppet.po +19 -0
- data/locales/ja/puppet.po +2739 -809
- data/locales/puppet.pot +2367 -734
- data/spec/fixtures/unit/application/environments/production/data/common.yaml +2 -0
- data/spec/integration/agent/logging_spec.rb +2 -0
- data/spec/integration/faces/plugin_spec.rb +1 -0
- data/spec/integration/network/authconfig_spec.rb +2 -2
- data/spec/integration/parser/collection_spec.rb +2 -2
- data/spec/integration/parser/scope_spec.rb +16 -3
- data/spec/integration/provider/cron/crontab_spec.rb +1 -0
- data/spec/integration/transaction/report_spec.rb +5 -0
- data/spec/lib/matchers/json.rb +14 -13
- data/spec/unit/agent_spec.rb +33 -0
- data/spec/unit/application/config_spec.rb +4 -0
- data/spec/unit/application/lookup_spec.rb +30 -0
- data/spec/unit/application_spec.rb +18 -0
- data/spec/unit/configurer/downloader_factory_spec.rb +33 -0
- data/spec/unit/configurer/plugin_handler_spec.rb +71 -16
- data/spec/unit/environments_spec.rb +15 -0
- data/spec/unit/face/config_spec.rb +8 -9
- data/spec/unit/face/epp_face_spec.rb +2 -2
- data/spec/unit/face/plugin_spec.rb +50 -4
- data/spec/unit/file_serving/configuration/parser_spec.rb +2 -2
- data/spec/unit/file_serving/mount/locales_spec.rb +73 -0
- data/spec/unit/functions/break_spec.rb +108 -50
- data/spec/unit/functions/defined_spec.rb +2 -2
- data/spec/unit/functions/hiera_spec.rb +0 -1
- data/spec/unit/functions/lookup_spec.rb +85 -19
- data/spec/unit/functions/next_spec.rb +1 -1
- data/spec/unit/functions/return_spec.rb +2 -2
- data/spec/unit/gettext/config_spec.rb +125 -0
- data/spec/unit/gettext/module_loading_spec.rb +53 -0
- data/spec/unit/indirector/json_spec.rb +0 -11
- data/spec/unit/indirector/node/exec_spec.rb +1 -1
- data/spec/unit/info_service_spec.rb +1 -1
- data/spec/unit/interface_spec.rb +12 -0
- data/spec/unit/module_spec.rb +0 -28
- data/spec/unit/module_tool/tar/mini_spec.rb +34 -5
- data/spec/unit/network/http/factory_spec.rb +22 -0
- data/spec/unit/network/http/webrick_spec.rb +30 -29
- data/spec/unit/node/environment_spec.rb +16 -0
- data/spec/unit/node_spec.rb +102 -16
- data/spec/unit/parser/environment_compiler_spec.rb +1 -1
- data/spec/unit/parser/functions/sprintf_spec.rb +26 -0
- data/spec/unit/parser/resource/param_spec.rb +1 -1
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +9 -9
- data/spec/unit/pops/loaders/static_loader_spec.rb +1 -1
- data/spec/unit/pops/parser/parse_containers_spec.rb +1 -1
- data/spec/unit/pops/types/type_calculator_spec.rb +40 -0
- data/spec/unit/pops/types/type_mismatch_describer_spec.rb +9 -0
- data/spec/unit/provider/selmodule_spec.rb +6 -0
- data/spec/unit/provider/service/init_spec.rb +1 -1
- data/spec/unit/provider/service/smf_spec.rb +2 -0
- data/spec/unit/provider/service/systemd_spec.rb +14 -0
- data/spec/unit/resource/catalog_spec.rb +12 -2
- data/spec/unit/settings/config_file_spec.rb +1 -1
- data/spec/unit/transaction/persistence_spec.rb +42 -0
- data/spec/unit/transaction/report_spec.rb +19 -4
- data/spec/unit/transaction_spec.rb +27 -0
- data/spec/unit/type/schedule_spec.rb +14 -0
- data/spec/unit/type_spec.rb +3 -3
- data/spec/unit/util/errors_spec.rb +1 -1
- data/spec/unit/util/http_proxy_spec.rb +37 -0
- data/spec/unit/util/log_spec.rb +3 -3
- data/spec/unit/util/logging_spec.rb +7 -7
- data/spec/unit/util/monkey_patches_spec.rb +6 -2
- metadata +3435 -3416
- checksums.yaml +0 -7
- data/spec/unit/gettext_config_spec.rb +0 -57
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'puppet/gettext/config'
|
2
|
+
|
3
|
+
module Puppet::ModuleTranslations
|
4
|
+
|
5
|
+
# @api private
|
6
|
+
# Loads translation files for each of the specified modules,
|
7
|
+
# if present. Requires the modules to have `forge_name` specified.
|
8
|
+
# @param [[Module]] modules a list of modules for which to
|
9
|
+
# load translations
|
10
|
+
def self.load_from_modulepath(modules)
|
11
|
+
modules.each do |mod|
|
12
|
+
next unless mod.forge_name && mod.has_translations?(Puppet::GettextConfig.current_locale)
|
13
|
+
|
14
|
+
module_name = mod.forge_name.gsub('/', '-')
|
15
|
+
if Puppet::GettextConfig.load_translations(module_name, mod.locale_directory, :po)
|
16
|
+
Puppet.debug "Loaded translations for #{module_name}."
|
17
|
+
elsif Puppet::GettextConfig.gettext_loaded?
|
18
|
+
Puppet.debug "Could not find translation files for #{module_name} at #{mod.locale_directory}. Skipping translation initialization."
|
19
|
+
else
|
20
|
+
Puppet.warn_once("gettext_unavailable", "gettext_unavailable", "No gettext library found, skipping translation initialization.")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# @api private
|
26
|
+
# Loads translation files that have been pluginsync'd for modules
|
27
|
+
# from the $vardir.
|
28
|
+
# @param [String] vardir the path to Puppet's vardir
|
29
|
+
def self.load_from_vardir(vardir)
|
30
|
+
locale = Puppet::GettextConfig.current_locale
|
31
|
+
Dir.glob("#{vardir}/locales/#{locale}/*.po") do |f|
|
32
|
+
module_name = File.basename(f, ".po")
|
33
|
+
if Puppet::GettextConfig.load_translations(module_name, File.join(vardir, "locales"), :po)
|
34
|
+
Puppet.debug "Loaded translations for #{module_name}."
|
35
|
+
elsif Puppet::GettextConfig.gettext_loaded?
|
36
|
+
Puppet.debug "Could not load translations for #{module_name}."
|
37
|
+
else
|
38
|
+
Puppet.warn_once("gettext_unavailable", "gettext_unavailable", "No gettext library found, skipping translation initialization.")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -70,7 +70,7 @@ class Puppet::Graph::RelationshipGraph < Puppet::Graph::SimpleGraph
|
|
70
70
|
if @blockers[resource] > 0
|
71
71
|
@blockers[resource] -= 1
|
72
72
|
else
|
73
|
-
resource.warning "appears to have a negative number of dependencies"
|
73
|
+
resource.warning _("appears to have a negative number of dependencies")
|
74
74
|
end
|
75
75
|
@blockers[resource] <= 0
|
76
76
|
end
|
@@ -229,17 +229,17 @@ class Puppet::Graph::SimpleGraph
|
|
229
229
|
return if number_of_cycles == 0
|
230
230
|
|
231
231
|
message = n_("Found %{num} dependency cycle:\n", "Found %{num} dependency cycles:\n", number_of_cycles) % { num: number_of_cycles }
|
232
|
+
|
232
233
|
cycles.each do |cycle|
|
233
234
|
paths = paths_in_cycle(cycle)
|
234
|
-
message += paths.map{ |path| '(' + path.join(
|
235
|
+
message += paths.map{ |path| '(' + path.join(' => ') + ')'}.join('\n') + '\n'
|
235
236
|
end
|
236
237
|
|
237
238
|
if Puppet[:graph] then
|
238
239
|
filename = write_cycles_to_graph(cycles)
|
239
240
|
message += _("Cycle graph written to %{filename}.") % { filename: filename }
|
240
241
|
else
|
241
|
-
#TRANSLATORS
|
242
|
-
#TRANSLATORS OmniGraffle and GraphViz and program names and should not be translated
|
242
|
+
#TRANSLATORS '--graph' refers to a command line option and OmniGraffle and GraphViz are program names and should not be translated
|
243
243
|
message += _("Try the '--graph' option and opening the resulting '.dot' file in OmniGraffle or GraphViz")
|
244
244
|
end
|
245
245
|
Puppet.err(message)
|
@@ -49,6 +49,8 @@ class Puppet::Resource::Catalog::Compiler < Puppet::Indirector::Code
|
|
49
49
|
node = node_from_request(facts, request)
|
50
50
|
node.trusted_data = Puppet.lookup(:trusted_information) { Puppet::Context::TrustedInformation.local(node) }.to_h
|
51
51
|
|
52
|
+
node.environment.use_text_domain if node.environment
|
53
|
+
|
52
54
|
if catalog = compile(node, request.options)
|
53
55
|
return catalog
|
54
56
|
else
|
@@ -89,7 +91,7 @@ class Puppet::Resource::Catalog::Compiler < Puppet::Indirector::Code
|
|
89
91
|
elsif format == 'application/json'
|
90
92
|
return Puppet::Node::Facts.convert_from('json', CGI.unescape(facts))
|
91
93
|
else
|
92
|
-
raise ArgumentError, "Unsupported facts format"
|
94
|
+
raise ArgumentError, _("Unsupported facts format")
|
93
95
|
end
|
94
96
|
end
|
95
97
|
|
@@ -275,24 +277,31 @@ class Puppet::Resource::Catalog::Compiler < Puppet::Indirector::Code
|
|
275
277
|
raise Puppet::Error, _("Unable to find a common checksum type between agent '%{agent_type}' and master '%{master_type}'.") % { agent_type: options[:checksum_type], master_type: known_checksum_types } unless checksum_type
|
276
278
|
end
|
277
279
|
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
280
|
+
escaped_node_name = node.name.gsub(/%/, '%%')
|
281
|
+
if checksum_type
|
282
|
+
if node.environment
|
283
|
+
escaped_node_environment = node.environment.to_s.gsub(/%/, '%%')
|
284
|
+
benchmark_str = _("Compiled static catalog for %{node} in environment %{environment} in %%{seconds} seconds") % { node: escaped_node_name, environment: escaped_node_environment }
|
285
|
+
profile_str = _("Compiled static catalog for %{node} in environment %{environment}") % { node: node.name, environment: node.environment }
|
286
|
+
else
|
287
|
+
benchmark_str = _("Compiled static catalog for %{node} in %%{seconds} seconds") % { node: escaped_node_name }
|
288
|
+
profile_str = _("Compiled static catalog for %{node}") % { node: node.name }
|
289
|
+
end
|
290
|
+
else
|
291
|
+
if node.environment
|
292
|
+
escaped_node_environment = node.environment.to_s.gsub(/%/, '%%')
|
293
|
+
benchmark_str = _("Compiled catalog for %{node} in environment %{environment} in %%{seconds} seconds") % { node: escaped_node_name, environment: escaped_node_environment }
|
294
|
+
profile_str = _("Compiled catalog for %{node} in environment %{environment}") % { node: node.name, environment: node.environment }
|
295
|
+
else
|
296
|
+
benchmark_str = _("Compiled catalog for %{node} in %%{seconds} seconds") % { node: escaped_node_name }
|
297
|
+
profile_str = _("Compiled catalog for %{node}") % { node: node.name }
|
298
|
+
end
|
299
|
+
end
|
291
300
|
config = nil
|
292
301
|
|
293
|
-
benchmark(:notice,
|
302
|
+
benchmark(:notice, benchmark_str) do
|
294
303
|
compile_type = checksum_type ? :static_compile : :compile
|
295
|
-
Puppet::Util::Profiler.profile(
|
304
|
+
Puppet::Util::Profiler.profile(profile_str, [:compiler, compile_type, node.environment, node.name]) do
|
296
305
|
begin
|
297
306
|
config = Puppet::Parser::Compiler.compile(node, options[:code_id])
|
298
307
|
rescue Puppet::Error => detail
|
@@ -303,15 +312,21 @@ class Puppet::Resource::Catalog::Compiler < Puppet::Indirector::Code
|
|
303
312
|
end
|
304
313
|
|
305
314
|
if checksum_type && config.is_a?(model)
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
+
escaped_node_name = node.name.gsub(/%/, '%%')
|
316
|
+
if node.environment
|
317
|
+
escaped_node_environment = node.environment.to_s.gsub(/%/, '%%')
|
318
|
+
#TRANSLATORS Inlined refers to adding additional metadata
|
319
|
+
benchmark_str = _("Inlined resource metadata into static catalog for %{node} in environment %{environment} in %%{seconds} seconds") % { node: escaped_node_name, environment: escaped_node_environment }
|
320
|
+
#TRANSLATORS Inlined refers to adding additional metadata
|
321
|
+
profile_str = _("Inlined resource metadata into static catalog for %{node} in environment %{environment}") % { node: node.name, environment: node.environment }
|
322
|
+
else
|
323
|
+
#TRANSLATORS Inlined refers to adding additional metadata
|
324
|
+
benchmark_str = _("Inlined resource metadata into static catalog for %{node} in %%{seconds} seconds") % { node: escaped_node_name }
|
325
|
+
#TRANSLATORS Inlined refers to adding additional metadata
|
326
|
+
profile_str = _("Inlined resource metadata into static catalog for %{node}") % { node: node.name }
|
327
|
+
end
|
328
|
+
benchmark(:notice, benchmark_str) do
|
329
|
+
Puppet::Util::Profiler.profile(profile_str, [:compiler, :static_compile_postprocessing, node.environment, node.name]) do
|
315
330
|
inline_metadata(config, checksum_type)
|
316
331
|
end
|
317
332
|
end
|
@@ -8,7 +8,7 @@ class Puppet::Indirector::Exec < Puppet::Indirector::Terminus
|
|
8
8
|
external_command = command
|
9
9
|
|
10
10
|
# Make sure it's an array
|
11
|
-
raise Puppet::DevError, "Exec commands must be an array" unless external_command.is_a?(Array)
|
11
|
+
raise Puppet::DevError, _("Exec commands must be an array") unless external_command.is_a?(Array)
|
12
12
|
|
13
13
|
# Make sure it's fully qualified.
|
14
14
|
raise ArgumentError, _("You must set the exec parameter to a fully qualified command") unless Puppet::Util.absolute_path?(external_command[0])
|
@@ -11,11 +11,11 @@ class Puppet::Node::Facts::Facter < Puppet::Indirector::Code
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def destroy(facts)
|
14
|
-
raise Puppet::DevError, 'You cannot destroy facts in the code store; it is only used for getting facts from Facter'
|
14
|
+
raise Puppet::DevError, _('You cannot destroy facts in the code store; it is only used for getting facts from Facter')
|
15
15
|
end
|
16
16
|
|
17
17
|
def save(facts)
|
18
|
-
raise Puppet::DevError, 'You cannot save facts to the code store; it is only used for getting facts from Facter'
|
18
|
+
raise Puppet::DevError, _('You cannot save facts to the code store; it is only used for getting facts from Facter')
|
19
19
|
end
|
20
20
|
|
21
21
|
# Lookup a host's facts up in Facter.
|
@@ -55,7 +55,7 @@ class Puppet::Node::Facts::Facter < Puppet::Indirector::Code
|
|
55
55
|
# print out each .rb in the facts directory as module
|
56
56
|
# developers may find that information useful for debugging purposes
|
57
57
|
if Puppet::Util::Log.sendlevel?(:info)
|
58
|
-
Puppet.info "Loading facts"
|
58
|
+
Puppet.info _("Loading facts")
|
59
59
|
Dir.glob("#{dir}/*.rb").each do |file|
|
60
60
|
Puppet.debug "Loading facts from #{file}"
|
61
61
|
end
|
@@ -18,10 +18,10 @@ class Puppet::Node::Facts::NetworkDevice < Puppet::Indirector::Code
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def destroy(facts)
|
21
|
-
raise Puppet::DevError, "You cannot destroy facts in the code store; it is only used for getting facts from a remote device"
|
21
|
+
raise Puppet::DevError, _("You cannot destroy facts in the code store; it is only used for getting facts from a remote device")
|
22
22
|
end
|
23
23
|
|
24
24
|
def save(facts)
|
25
|
-
raise Puppet::DevError, "You cannot save facts to the code store; it is only used for getting facts from a remote device"
|
25
|
+
raise Puppet::DevError, _("You cannot save facts to the code store; it is only used for getting facts from a remote device")
|
26
26
|
end
|
27
27
|
end
|
@@ -29,6 +29,7 @@ module Puppet::FileBucketFile
|
|
29
29
|
raise _("Unable to diff on this platform") unless Puppet[:diff] != ""
|
30
30
|
return diff(Puppet::FileSystem.path_string(contents_file), Puppet::FileSystem.path_string(other_contents_file))
|
31
31
|
else
|
32
|
+
#TRANSLATORS "FileBucket" should not be translated
|
32
33
|
Puppet.info _("FileBucket read %{checksum}") % { checksum: checksum }
|
33
34
|
model.new(Puppet::FileSystem.binread(contents_file))
|
34
35
|
end
|
@@ -158,7 +159,8 @@ module Puppet::FileBucketFile
|
|
158
159
|
Puppet::FileSystem.exclusive_open(paths_file, 0640, 'a+:external') do |f|
|
159
160
|
if Puppet::FileSystem.exist?(contents_file)
|
160
161
|
if verify_identical_file(contents_file, bucket_file)
|
161
|
-
|
162
|
+
#TRANSLATORS "FileBucket" should not be translated
|
163
|
+
Puppet.info _("FileBucket got a duplicate file %{file_checksum}") % { file_checksum: bucket_file.checksum }
|
162
164
|
Puppet::FileSystem.touch(contents_file)
|
163
165
|
elsif contents_file_matches_checksum?(contents_file, bucket_file.checksum_data, bucket_file.checksum_type)
|
164
166
|
# If the contents or sizes don't match, but the checksum does,
|
@@ -167,6 +169,7 @@ module Puppet::FileBucketFile
|
|
167
169
|
# needed, but ask the user to validate.
|
168
170
|
# Note: Don't print the full path to the bucket file in the
|
169
171
|
# exception to avoid disclosing file system layout on server.
|
172
|
+
#TRANSLATORS "FileBucket" should not be translated
|
170
173
|
Puppet.err(_("Unable to verify existing FileBucket backup at '%{path}'.") % { path: contents_file.to_path })
|
171
174
|
raise Puppet::FileBucket::BucketError, _("Existing backup and new file have different content but same checksum, %{value}. Verify existing backup and remove if incorrect.") %
|
172
175
|
{ value: bucket_file.checksum }
|
@@ -37,7 +37,7 @@ class Puppet::Indirector::Indirection
|
|
37
37
|
|
38
38
|
# Create and return our cache terminus.
|
39
39
|
def cache
|
40
|
-
raise
|
40
|
+
raise Puppet::DevError, _("Tried to cache when no cache class was set") unless cache_class
|
41
41
|
terminus(cache_class)
|
42
42
|
end
|
43
43
|
|
@@ -97,7 +97,7 @@ class Puppet::Indirector::Indirection
|
|
97
97
|
@cache_class = nil
|
98
98
|
@terminus_class = nil
|
99
99
|
|
100
|
-
raise(ArgumentError, "Indirection
|
100
|
+
raise(ArgumentError, _("Indirection %{name} is already defined") % { name: @name }) if @@indirections.find { |i| i.name == @name }
|
101
101
|
@@indirections << self
|
102
102
|
|
103
103
|
@indirected_class = options.delete(:indirected_class)
|
@@ -118,7 +118,7 @@ class Puppet::Indirector::Indirection
|
|
118
118
|
# Return the singleton terminus for this indirection.
|
119
119
|
def terminus(terminus_name = nil)
|
120
120
|
# Get the name of the terminus.
|
121
|
-
raise Puppet::DevError, "No terminus specified for
|
121
|
+
raise Puppet::DevError, _("No terminus specified for %{name}; cannot redirect") % { name: self.name } unless terminus_name ||= terminus_class
|
122
122
|
|
123
123
|
termini[terminus_name] ||= make_terminus(terminus_name)
|
124
124
|
end
|
@@ -132,7 +132,7 @@ class Puppet::Indirector::Indirection
|
|
132
132
|
if setting = self.terminus_setting
|
133
133
|
self.terminus_class = Puppet.settings[setting]
|
134
134
|
else
|
135
|
-
raise Puppet::DevError, "No terminus class nor terminus setting was provided for indirection
|
135
|
+
raise Puppet::DevError, _("No terminus class nor terminus setting was provided for indirection %{name}") % { name: self.name}
|
136
136
|
end
|
137
137
|
end
|
138
138
|
@terminus_class
|
@@ -150,9 +150,12 @@ class Puppet::Indirector::Indirection
|
|
150
150
|
|
151
151
|
# This is used by terminus_class= and cache=.
|
152
152
|
def validate_terminus_class(terminus_class)
|
153
|
-
|
153
|
+
unless terminus_class and terminus_class.to_s != ""
|
154
|
+
raise ArgumentError, _("Invalid terminus name %{terminus_class}") % { terminus_class: terminus_class.inspect }
|
155
|
+
end
|
154
156
|
unless Puppet::Indirector::Terminus.terminus_class(self.name, terminus_class)
|
155
|
-
raise ArgumentError, "Could not find terminus
|
157
|
+
raise ArgumentError, _("Could not find terminus %{terminus_class} for indirection %{name}") %
|
158
|
+
{ terminus_class: terminus_class, name: self.name }
|
156
159
|
end
|
157
160
|
end
|
158
161
|
|
@@ -268,7 +271,7 @@ class Puppet::Indirector::Indirection
|
|
268
271
|
terminus = prepare(request)
|
269
272
|
|
270
273
|
if result = terminus.search(request)
|
271
|
-
raise Puppet::DevError, "Search results from terminus
|
274
|
+
raise Puppet::DevError, _("Search results from terminus %{terminus_name} are not an array") % { terminus_name: terminus.name } unless result.is_a?(Array)
|
272
275
|
result.each do |instance|
|
273
276
|
next unless instance.respond_to? :expiration
|
274
277
|
instance.expiration ||= self.expiration
|
@@ -304,8 +307,13 @@ class Puppet::Indirector::Indirection
|
|
304
307
|
return unless terminus.respond_to?(:authorized?)
|
305
308
|
|
306
309
|
unless terminus.authorized?(request)
|
307
|
-
msg =
|
308
|
-
|
310
|
+
msg = if request.options.empty?
|
311
|
+
_("Not authorized to call %{method} on %{description}") %
|
312
|
+
{ method: request.method, description: request.description }
|
313
|
+
else
|
314
|
+
_("Not authorized to call %{method} on %{description} with %{option}") %
|
315
|
+
{ method: request.method, description: request.description, option: request.options.inspect }
|
316
|
+
end
|
309
317
|
raise ArgumentError, msg
|
310
318
|
end
|
311
319
|
end
|
@@ -10,7 +10,7 @@ class Puppet::Indirector::Ldap < Puppet::Indirector::Terminus
|
|
10
10
|
# Process the found entry. We assume that we don't just want the
|
11
11
|
# ldap object.
|
12
12
|
def process(entry)
|
13
|
-
raise Puppet::DevError, "The 'process' method has not been overridden for the LDAP terminus for
|
13
|
+
raise Puppet::DevError, _("The 'process' method has not been overridden for the LDAP terminus for %{name}") % { name: self.name }
|
14
14
|
end
|
15
15
|
|
16
16
|
# Default to all attributes.
|
@@ -24,7 +24,7 @@ class Puppet::Indirector::Ldap < Puppet::Indirector::Terminus
|
|
24
24
|
|
25
25
|
# The ldap search filter to use.
|
26
26
|
def search_filter(name)
|
27
|
-
raise Puppet::DevError, "No search string set for LDAP terminus for
|
27
|
+
raise Puppet::DevError, _("No search string set for LDAP terminus for %{name}") % { name: self.name }
|
28
28
|
end
|
29
29
|
|
30
30
|
# Find the ldap node, return the class list and parent node specially,
|
@@ -12,7 +12,9 @@ require 'puppet/indirector/yaml'
|
|
12
12
|
#
|
13
13
|
class Puppet::Node::WriteOnlyYaml < Puppet::Indirector::Yaml
|
14
14
|
def initialize
|
15
|
-
|
15
|
+
#TRANSLATORS 'Puppet::Node::WriteOnlyYaml' is a class and should not be translated
|
16
|
+
message = _('Puppet::Node::WriteOnlyYaml is deprecated and will be removed in a future release of Puppet.')
|
17
|
+
Puppet.warn_once('deprecations', 'Puppet::Node::WriteOnlyYaml', message)
|
16
18
|
super
|
17
19
|
end
|
18
20
|
|
@@ -262,11 +262,14 @@ class Puppet::Indirector::REST < Puppet::Indirector::Terminus
|
|
262
262
|
|
263
263
|
def handle_response(request, response)
|
264
264
|
server_version = response[Puppet::Network::HTTP::HEADER_PUPPET_VERSION]
|
265
|
-
if server_version
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
265
|
+
if server_version
|
266
|
+
Puppet.push_context({:server_agent_version => server_version})
|
267
|
+
if SemanticPuppet::Version.parse(server_version).major < MAJOR_VERSION_JSON_DEFAULT &&
|
268
|
+
Puppet[:preferred_serialization_format] != 'pson'
|
269
|
+
#TRANSLATORS "PSON" should not be translated
|
270
|
+
Puppet.warning(_("Downgrading to PSON for future requests"))
|
271
|
+
Puppet[:preferred_serialization_format] = 'pson'
|
272
|
+
end
|
270
273
|
end
|
271
274
|
end
|
272
275
|
|
@@ -49,7 +49,7 @@ class Puppet::Indirector::SslFile < Puppet::Indirector::Terminus
|
|
49
49
|
def initialize
|
50
50
|
Puppet.settings.use(:main, :ssl)
|
51
51
|
|
52
|
-
(collection_directory || file_location) or raise Puppet::DevError, "No file or directory setting provided; terminus
|
52
|
+
(collection_directory || file_location) or raise Puppet::DevError, _("No file or directory setting provided; terminus %{class_name} cannot function") % { class_name: self.class.name }
|
53
53
|
end
|
54
54
|
|
55
55
|
def path(name)
|
@@ -190,7 +190,7 @@ class Puppet::Indirector::SslFile < Puppet::Indirector::Terminus
|
|
190
190
|
raise Puppet::Error, _("Could not write %{path} to %{setting}: %{detail}") % { path: path, setting: setting, detail: detail }, detail.backtrace
|
191
191
|
end
|
192
192
|
else
|
193
|
-
raise Puppet::DevError, "You must provide a setting to determine where the files are stored"
|
193
|
+
raise Puppet::DevError, _("You must provide a setting to determine where the files are stored")
|
194
194
|
end
|
195
195
|
end
|
196
196
|
end
|
@@ -46,7 +46,7 @@ class Puppet::Indirector::Terminus
|
|
46
46
|
def inherited(subclass)
|
47
47
|
longname = subclass.to_s
|
48
48
|
if longname =~ /#<Class/
|
49
|
-
raise Puppet::DevError, "Terminus subclasses must have associated constants"
|
49
|
+
raise Puppet::DevError, _("Terminus subclasses must have associated constants")
|
50
50
|
end
|
51
51
|
names = longname.split("::")
|
52
52
|
|
@@ -71,7 +71,7 @@ class Puppet::Indirector::Terminus
|
|
71
71
|
processed_name = names.pop.sub(/^[A-Z]/) { |i| i.downcase }.gsub(/[A-Z]/) { |i| "_#{i.downcase}" }
|
72
72
|
|
73
73
|
if processed_name.empty?
|
74
|
-
raise Puppet::DevError, "Could not discern indirection model from class constant"
|
74
|
+
raise Puppet::DevError, _("Could not discern indirection model from class constant")
|
75
75
|
end
|
76
76
|
|
77
77
|
# This will throw an exception if the indirection instance cannot be found.
|
@@ -129,7 +129,7 @@ class Puppet::Indirector::Terminus
|
|
129
129
|
end
|
130
130
|
|
131
131
|
def initialize
|
132
|
-
raise Puppet::DevError, "Cannot create instances of abstract terminus types" if self.class.abstract_terminus?
|
132
|
+
raise Puppet::DevError, _("Cannot create instances of abstract terminus types") if self.class.abstract_terminus?
|
133
133
|
end
|
134
134
|
|
135
135
|
def model
|
data/lib/puppet/interface.rb
CHANGED
@@ -149,7 +149,7 @@ class Puppet::Interface
|
|
149
149
|
# @api private
|
150
150
|
def initialize(name, version, &block)
|
151
151
|
unless SemanticPuppet::Version.valid?(version)
|
152
|
-
raise ArgumentError, "Cannot create face
|
152
|
+
raise ArgumentError, _("Cannot create face %{name} with invalid version number '%{version}'!") % { name: name.inspect, version: version }
|
153
153
|
end
|
154
154
|
|
155
155
|
@name = Puppet::Interface::FaceCollection.underscorize(name)
|
@@ -178,6 +178,7 @@ class Puppet::Interface
|
|
178
178
|
def to_s
|
179
179
|
"Puppet::Face[#{name.inspect}, #{version.inspect}]"
|
180
180
|
end
|
181
|
+
alias_method :inspect, :to_s
|
181
182
|
|
182
183
|
# @return [void]
|
183
184
|
def deprecate
|
@@ -78,7 +78,7 @@ class Puppet::Interface::Action
|
|
78
78
|
# @api private
|
79
79
|
def when_rendering(type)
|
80
80
|
unless type.is_a? Symbol
|
81
|
-
raise ArgumentError, "The rendering format must be a symbol, not
|
81
|
+
raise ArgumentError, _("The rendering format must be a symbol, not %{class_name}") % { class_name: type.class.name }
|
82
82
|
end
|
83
83
|
# Do we have a rendering hook for this name?
|
84
84
|
return @when_rendering[type].bind(@face) if @when_rendering.has_key? type
|
@@ -94,28 +94,38 @@ class Puppet::Interface::Action
|
|
94
94
|
# @api private
|
95
95
|
def set_rendering_method_for(type, proc)
|
96
96
|
unless proc.is_a? Proc
|
97
|
-
msg =
|
98
|
-
|
97
|
+
msg = if proc.nil?
|
98
|
+
#TRANSLATORS 'set_rendering_method_for' and 'Proc' should not be translated
|
99
|
+
_("The second argument to set_rendering_method_for must be a Proc")
|
100
|
+
else
|
101
|
+
#TRANSLATORS 'set_rendering_method_for' and 'Proc' should not be translated
|
102
|
+
_("The second argument to set_rendering_method_for must be a Proc, not %{class_name}") %
|
103
|
+
{ class_name: proc.class.name }
|
104
|
+
end
|
99
105
|
raise ArgumentError, msg
|
100
106
|
end
|
101
107
|
|
102
108
|
if proc.arity != 1 and proc.arity != (@positional_arg_count + 1)
|
103
|
-
msg =
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
109
|
+
msg = if proc.arity < 0 then
|
110
|
+
#TRANSLATORS 'when_rendering', 'when_invoked' are method names and should not be translated
|
111
|
+
_("The when_rendering method for the %{face} face %{name} action takes either just one argument,"\
|
112
|
+
" the result of when_invoked, or the result plus the %{arg_count} arguments passed to the"\
|
113
|
+
" when_invoked block, not a variable number") %
|
114
|
+
{ face: @face.name, name: name, arg_count: @positional_arg_count }
|
115
|
+
else
|
116
|
+
#TRANSLATORS 'when_rendering', 'when_invoked' are method names and should not be translated
|
117
|
+
_("The when_rendering method for the %{face} face %{name} action takes either just one argument,"\
|
118
|
+
" the result of when_invoked, or the result plus the %{arg_count} arguments passed to the"\
|
119
|
+
" when_invoked block, not %{string}") %
|
120
|
+
{ face: @face.name, name: name, arg_count: @positional_arg_count, string: proc.arity.to_s }
|
121
|
+
end
|
112
122
|
raise ArgumentError, msg
|
113
123
|
end
|
114
124
|
unless type.is_a? Symbol
|
115
|
-
raise ArgumentError, "The rendering format must be a symbol, not
|
125
|
+
raise ArgumentError, _("The rendering format must be a symbol, not %{class_name}") % { class_name: type.class.name }
|
116
126
|
end
|
117
127
|
if @when_rendering.has_key? type then
|
118
|
-
raise ArgumentError, "You can't define a rendering method for
|
128
|
+
raise ArgumentError, _("You can't define a rendering method for %{type} twice") % { type: type }
|
119
129
|
end
|
120
130
|
# Now, the ugly bit. We add the method to our interface object, and
|
121
131
|
# retrieve it, to rotate through the dance of getting a suitable method
|
@@ -213,7 +223,8 @@ class Puppet::Interface::Action
|
|
213
223
|
# but will on 1.9.2, which treats it as "no arguments". Which bites,
|
214
224
|
# because this just begs for us to wind up in the horrible situation
|
215
225
|
# where a 1.8 vs 1.9 error bites our end users. --daniel 2011-04-19
|
216
|
-
|
226
|
+
#TRANSLATORS 'when_invoked' should not be translated
|
227
|
+
raise ArgumentError, _("when_invoked requires at least one argument (options) for action %{name}") % { name: @name }
|
217
228
|
elsif arity > 0 then
|
218
229
|
range = Range.new(1, arity - 1)
|
219
230
|
decl = range.map { |x| "arg#{x}" } << "options = {}"
|
@@ -259,9 +270,11 @@ WRAPPER
|
|
259
270
|
def add_option(option)
|
260
271
|
option.aliases.each do |name|
|
261
272
|
if conflict = get_option(name) then
|
262
|
-
raise ArgumentError, "Option
|
273
|
+
raise ArgumentError, _("Option %{option} conflicts with existing option %{conflict}") %
|
274
|
+
{ option: option, conflict: conflict }
|
263
275
|
elsif conflict = @face.get_option(name) then
|
264
|
-
raise ArgumentError, "Option
|
276
|
+
raise ArgumentError, _("Option %{option} conflicts with existing option %{conflict} on %{face}") %
|
277
|
+
{ option: option, conflict: conflict, face: @face }
|
265
278
|
end
|
266
279
|
end
|
267
280
|
|
@@ -285,7 +298,10 @@ WRAPPER
|
|
285
298
|
def add_display_global_options(*args)
|
286
299
|
@display_global_options ||= []
|
287
300
|
[args].flatten.each do |refopt|
|
288
|
-
|
301
|
+
unless Puppet.settings.include? refopt
|
302
|
+
#TRANSLATORS 'Puppet.settings' should not be translated
|
303
|
+
raise ArgumentError, _("Global option %{option} does not exist in Puppet.settings") % { option: refopt }
|
304
|
+
end
|
289
305
|
@display_global_options << refopt
|
290
306
|
end
|
291
307
|
@display_global_options.uniq!
|
@@ -331,13 +347,14 @@ WRAPPER
|
|
331
347
|
end
|
332
348
|
|
333
349
|
unless overlap.empty?
|
334
|
-
|
335
|
-
raise ArgumentError, "Multiple aliases for the same option passed:
|
350
|
+
overlap_list = overlap.map {|k, v| "(#{k}, #{v.sort.join(', ')})" }.join(", ")
|
351
|
+
raise ArgumentError, _("Multiple aliases for the same option passed: %{overlap_list}") %
|
352
|
+
{ overlap_list: overlap_list }
|
336
353
|
end
|
337
354
|
|
338
355
|
unless unknown.empty?
|
339
|
-
|
340
|
-
raise ArgumentError, "Unknown options passed:
|
356
|
+
unknown_list = unknown.sort.join(", ")
|
357
|
+
raise ArgumentError, _("Unknown options passed: %{unknown_list}") % { unknown_list: unknown_list }
|
341
358
|
end
|
342
359
|
|
343
360
|
# Inject default arguments and check for missing mandating options.
|
@@ -354,8 +371,8 @@ WRAPPER
|
|
354
371
|
end
|
355
372
|
|
356
373
|
unless missing.empty?
|
357
|
-
|
358
|
-
raise ArgumentError, "The following options are required:
|
374
|
+
missing_list = missing.sort.join(', ')
|
375
|
+
raise ArgumentError, _("The following options are required: %{missing_list}") % { missing_list: missing_list }
|
359
376
|
end
|
360
377
|
|
361
378
|
# All done.
|