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.
- 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 +3433 -3416
- checksums.yaml +0 -7
- data/spec/unit/gettext_config_spec.rb +0 -57
data/lib/puppet/daemon.rb
CHANGED
@@ -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
|
data/lib/puppet/defaults.rb
CHANGED
@@ -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
|
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
|
293
|
-
|
294
|
-
|
295
|
-
this provides the default environment for nodes
|
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
|
-
|
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
|
-
|
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
|
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
|
-
|
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
|
-
|
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
|
1559
|
-
|
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
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
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
|
-
|
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
|
)
|
data/lib/puppet/environments.rb
CHANGED
@@ -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
|
data/lib/puppet/error.rb
CHANGED
@@ -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
|
-
|
34
|
-
|
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
|
78
|
-
msg = "
|
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
|
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
|
|
data/lib/puppet/face/catalog.rb
CHANGED
@@ -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
|
data/lib/puppet/face/config.rb
CHANGED
@@ -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|
|
data/lib/puppet/face/epp.rb
CHANGED
@@ -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
|
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
|
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
|
data/lib/puppet/face/help.rb
CHANGED
@@ -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
|
-
|
82
|
-
Could not load help for the application %{applicationname}
|
83
|
-
Please check the error logs for more information.
|
84
|
-
|
85
|
-
Detail: "%{detail}"
|
86
|
-
|
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
|
-
|
95
|
-
Could not load help for the face %{facename}
|
96
|
-
Please check the error logs for more information.
|
97
|
-
|
98
|
-
Detail: "%{detail}"
|
99
|
-
|
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)
|
data/lib/puppet/face/man.rb
CHANGED
@@ -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: ")
|
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.
|
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.
|
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
|
-
|
160
|
+
_("Module '%{name}' (v%{version}) fails to meet some dependencies:\n") % { name: name, version: version }
|
172
161
|
when :non_semantic_version
|
173
|
-
|
162
|
+
_("Non semantic version dependency %{name} (v%{version}):\n") % { name: name, version: version }
|
174
163
|
else
|
175
|
-
|
164
|
+
_("Missing dependency '%{name}':\n") % { name: name }
|
176
165
|
end
|
177
166
|
|
178
167
|
errors.each { |error_string| msg << " #{error_string}\n" }
|