puppet 5.5.17-x86-mingw32 → 5.5.18-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CODEOWNERS +1 -1
- data/Gemfile +2 -3
- data/Gemfile.lock +35 -31
- data/ext/build_defaults.yaml +1 -0
- data/ext/cert_inspector +3 -3
- data/ext/puppet-test +2 -2
- data/ext/regexp_nodes/regexp_nodes.rb +4 -4
- data/ext/windows/service/daemon.rb +54 -8
- data/install.rb +6 -6
- data/lib/puppet/application.rb +1 -1
- data/lib/puppet/application/apply.rb +2 -2
- data/lib/puppet/application/describe.rb +3 -9
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/application/lookup.rb +1 -1
- data/lib/puppet/application/script.rb +2 -2
- data/lib/puppet/configurer.rb +86 -28
- data/lib/puppet/configurer/downloader.rb +2 -6
- data/lib/puppet/defaults.rb +17 -4
- data/lib/puppet/error.rb +9 -1
- data/lib/puppet/external/nagios/base.rb +1 -1
- data/lib/puppet/face/ca.rb +1 -1
- data/lib/puppet/face/module/list.rb +5 -5
- data/lib/puppet/face/module/search.rb +1 -1
- data/lib/puppet/face/module/uninstall.rb +1 -1
- data/lib/puppet/face/module/upgrade.rb +1 -1
- data/lib/puppet/file_serving/http_metadata.rb +1 -1
- data/lib/puppet/file_system.rb +0 -8
- data/lib/puppet/file_system/memory_file.rb +1 -1
- data/lib/puppet/file_system/posix.rb +3 -2
- data/lib/puppet/forge.rb +3 -3
- data/lib/puppet/functions/epp.rb +4 -4
- data/lib/puppet/functions/inline_epp.rb +5 -5
- data/lib/puppet/gettext/module_translations.rb +1 -1
- data/lib/puppet/graph/rb_tree_map.rb +2 -2
- data/lib/puppet/graph/simple_graph.rb +6 -5
- data/lib/puppet/indirector/file_bucket_file/file.rb +1 -1
- data/lib/puppet/indirector/hiera.rb +2 -0
- data/lib/puppet/indirector/resource/ral.rb +1 -3
- data/lib/puppet/indirector/resource/validator.rb +1 -1
- data/lib/puppet/interface.rb +2 -1
- data/lib/puppet/loaders.rb +0 -1
- data/lib/puppet/metatype/manager.rb +1 -1
- data/lib/puppet/module.rb +1 -1
- data/lib/puppet/module_tool/applications/builder.rb +1 -1
- data/lib/puppet/module_tool/applications/installer.rb +1 -1
- data/lib/puppet/module_tool/applications/uninstaller.rb +3 -3
- data/lib/puppet/module_tool/metadata.rb +1 -1
- data/lib/puppet/module_tool/shared_behaviors.rb +4 -4
- data/lib/puppet/module_tool/tar/mini.rb +1 -1
- data/lib/puppet/network/http/api/indirected_routes.rb +12 -11
- data/lib/puppet/network/http/connection.rb +10 -12
- data/lib/puppet/network/http/pool.rb +2 -0
- data/lib/puppet/network/http/rack/rest.rb +2 -2
- data/lib/puppet/network/http/site.rb +1 -1
- data/lib/puppet/network/resolver.rb +2 -2
- data/lib/puppet/node/environment.rb +4 -2
- data/lib/puppet/parser/ast.rb +1 -1
- data/lib/puppet/parser/ast/resourceparam.rb +1 -1
- data/lib/puppet/parser/functions.rb +1 -1
- data/lib/puppet/parser/functions/epp.rb +3 -3
- data/lib/puppet/parser/functions/inline_epp.rb +5 -5
- data/lib/puppet/pops/evaluator/collectors/catalog_collector.rb +1 -1
- data/lib/puppet/pops/evaluator/collectors/exported_collector.rb +1 -1
- data/lib/puppet/pops/evaluator/external_syntax_support.rb +3 -2
- data/lib/puppet/pops/evaluator/runtime3_support.rb +4 -4
- data/lib/puppet/pops/loaders.rb +1 -1
- data/lib/puppet/pops/lookup/hiera_config.rb +1 -0
- data/lib/puppet/pops/lookup/sub_lookup.rb +1 -1
- data/lib/puppet/pops/merge_strategy.rb +22 -18
- data/lib/puppet/pops/parser/heredoc_support.rb +1 -1
- data/lib/puppet/pops/parser/interpolation_support.rb +4 -4
- data/lib/puppet/pops/parser/locator.rb +1 -1
- data/lib/puppet/pops/parser/pn_parser.rb +17 -16
- data/lib/puppet/pops/puppet_stack.rb +51 -48
- data/lib/puppet/pops/types/p_sensitive_type.rb +1 -1
- data/lib/puppet/pops/types/string_converter.rb +10 -10
- data/lib/puppet/pops/types/types.rb +3 -3
- data/lib/puppet/property.rb +1 -1
- data/lib/puppet/property/ensure.rb +1 -1
- data/lib/puppet/provider/augeas/augeas.rb +1 -1
- data/lib/puppet/provider/cron/crontab.rb +1 -1
- data/lib/puppet/provider/exec.rb +6 -2
- data/lib/puppet/provider/mount.rb +1 -1
- data/lib/puppet/provider/mount/parsed.rb +8 -8
- data/lib/puppet/provider/nameservice/directoryservice.rb +1 -1
- data/lib/puppet/provider/nameservice/pw.rb +2 -2
- data/lib/puppet/provider/package/dnfmodule.rb +87 -0
- data/lib/puppet/provider/package/dpkg.rb +3 -12
- data/lib/puppet/provider/package/openbsd.rb +1 -1
- data/lib/puppet/provider/package/pip.rb +34 -9
- data/lib/puppet/provider/package/portage.rb +4 -4
- data/lib/puppet/provider/package/rpm.rb +6 -6
- data/lib/puppet/provider/package/windows/package.rb +1 -1
- data/lib/puppet/provider/package/yum.rb +1 -1
- data/lib/puppet/provider/package_targetable.rb +5 -4
- data/lib/puppet/provider/parsedfile.rb +1 -1
- data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +3 -3
- data/lib/puppet/provider/service/daemontools.rb +9 -9
- data/lib/puppet/provider/service/openbsd.rb +1 -1
- data/lib/puppet/provider/service/rcng.rb +2 -2
- data/lib/puppet/provider/service/runit.rb +2 -8
- data/lib/puppet/provider/service/systemd.rb +8 -8
- data/lib/puppet/provider/user/directoryservice.rb +1 -1
- data/lib/puppet/provider/user/hpux.rb +1 -1
- data/lib/puppet/provider/user/user_role_add.rb +1 -1
- data/lib/puppet/provider/user/useradd.rb +22 -13
- data/lib/puppet/provider/user/windows_adsi.rb +4 -5
- data/lib/puppet/provider/yumrepo/inifile.rb +2 -2
- data/lib/puppet/reference/indirection.rb +2 -2
- data/lib/puppet/reference/metaparameter.rb +1 -3
- data/lib/puppet/reference/providers.rb +1 -1
- data/lib/puppet/reference/type.rb +3 -9
- data/lib/puppet/reports.rb +1 -1
- data/lib/puppet/resource.rb +1 -1
- data/lib/puppet/resource/catalog.rb +1 -1
- data/lib/puppet/settings.rb +3 -3
- data/lib/puppet/settings/environment_conf.rb +1 -0
- data/lib/puppet/ssl/certificate_authority/interface.rb +1 -1
- data/lib/puppet/ssl/certificate_factory.rb +2 -2
- data/lib/puppet/ssl/host.rb +3 -3
- data/lib/puppet/ssl/oids.rb +1 -1
- data/lib/puppet/transaction/report.rb +1 -1
- data/lib/puppet/type.rb +2 -4
- data/lib/puppet/type/cron.rb +1 -1
- data/lib/puppet/type/exec.rb +7 -3
- data/lib/puppet/type/file.rb +1 -2
- data/lib/puppet/type/file/data_sync.rb +5 -1
- data/lib/puppet/type/group.rb +4 -2
- data/lib/puppet/type/interface.rb +1 -1
- data/lib/puppet/type/notify.rb +3 -2
- data/lib/puppet/type/package.rb +2 -2
- data/lib/puppet/type/schedule.rb +1 -1
- data/lib/puppet/type/selboolean.rb +17 -3
- data/lib/puppet/type/service.rb +1 -1
- data/lib/puppet/type/user.rb +4 -2
- data/lib/puppet/util.rb +35 -12
- data/lib/puppet/util/command_line/trollop.rb +1 -1
- data/lib/puppet/util/http_proxy.rb +8 -14
- data/lib/puppet/util/instance_loader.rb +1 -1
- data/lib/puppet/util/log.rb +1 -1
- data/lib/puppet/util/log/destinations.rb +2 -2
- data/lib/puppet/util/logging.rb +30 -18
- data/lib/puppet/util/metric.rb +2 -2
- data/lib/puppet/util/monkey_patches.rb +1 -1
- data/lib/puppet/util/nagios_maker.rb +2 -2
- data/lib/puppet/util/network_device/cisco/device.rb +1 -1
- data/lib/puppet/util/network_device/cisco/interface.rb +2 -2
- data/lib/puppet/util/network_device/transport/ssh.rb +1 -1
- data/lib/puppet/util/provider_features.rb +2 -4
- data/lib/puppet/util/rdoc.rb +1 -1
- data/lib/puppet/util/reference.rb +1 -1
- data/lib/puppet/util/resource_template.rb +1 -1
- data/lib/puppet/util/selinux.rb +3 -1
- data/lib/puppet/util/windows/adsi.rb +58 -28
- data/lib/puppet/util/windows/registry.rb +7 -5
- data/lib/puppet/vendor.rb +1 -1
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet_pal.rb +2 -2
- data/locales/puppet.pot +115 -95
- data/man/man5/puppet.conf.5 +21 -5
- data/man/man8/puppet-agent.8 +1 -1
- data/man/man8/puppet-apply.8 +1 -1
- data/man/man8/puppet-ca.8 +1 -1
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-cert.8 +1 -1
- data/man/man8/puppet-certificate.8 +1 -1
- data/man/man8/puppet-certificate_request.8 +1 -1
- data/man/man8/puppet-certificate_revocation_list.8 +1 -1
- data/man/man8/puppet-config.8 +1 -1
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +1 -1
- data/man/man8/puppet-doc.8 +1 -1
- data/man/man8/puppet-epp.8 +1 -1
- data/man/man8/puppet-facts.8 +1 -1
- data/man/man8/puppet-filebucket.8 +1 -1
- data/man/man8/puppet-generate.8 +1 -1
- data/man/man8/puppet-help.8 +1 -1
- data/man/man8/puppet-key.8 +1 -1
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-man.8 +1 -1
- data/man/man8/puppet-master.8 +1 -1
- data/man/man8/puppet-module.8 +1 -1
- data/man/man8/puppet-node.8 +1 -1
- data/man/man8/puppet-parser.8 +1 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-report.8 +1 -1
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-script.8 +1 -1
- data/man/man8/puppet-status.8 +1 -1
- data/man/man8/puppet.8 +2 -2
- data/spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-installed.txt +11 -0
- data/spec/integration/configurer_spec.rb +52 -0
- data/spec/integration/type/notify_spec.rb +46 -0
- data/spec/unit/configurer_spec.rb +380 -397
- data/spec/unit/forge/forge_spec.rb +1 -3
- data/spec/unit/forge/repository_spec.rb +1 -3
- data/spec/unit/indirector/resource/ral_spec.rb +4 -4
- data/spec/unit/network/http/connection_spec.rb +26 -0
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +8 -3
- data/spec/unit/provider/exec_spec.rb +209 -0
- data/spec/unit/provider/package/dnfmodule_spec.rb +186 -0
- data/spec/unit/provider/package/dpkg_spec.rb +15 -3
- data/spec/unit/provider/package/pip_spec.rb +51 -6
- data/spec/unit/provider/package/portage_spec.rb +4 -4
- data/spec/unit/provider/package_targetable_spec.rb +60 -0
- data/spec/unit/provider/service/daemontools_spec.rb +24 -0
- data/spec/unit/provider/service/runit_spec.rb +24 -0
- data/spec/unit/provider/service/systemd_spec.rb +22 -22
- data/spec/unit/provider/user/hpux_spec.rb +2 -2
- data/spec/unit/provider/user/useradd_spec.rb +46 -0
- data/spec/unit/type/exec_spec.rb +6 -12
- data/spec/unit/type/file/content_spec.rb +9 -3
- data/spec/unit/type/file_spec.rb +9 -4
- data/spec/unit/type/selboolean_spec.rb +4 -6
- data/spec/unit/util/execution_spec.rb +16 -0
- data/spec/unit/util/http_proxy_spec.rb +97 -0
- data/spec/unit/util/log/destinations_spec.rb +7 -3
- data/spec/unit/util/log_spec.rb +0 -138
- data/spec/unit/util/logging_spec.rb +200 -0
- data/spec/unit/util/windows/adsi_spec.rb +51 -0
- data/tasks/manpages.rake +1 -0
- metadata +12 -5
- data/lib/puppet/pops/loader/null_loader.rb +0 -60
- data/locales/ja/puppet.po +0 -12114
@@ -154,7 +154,7 @@ HELP
|
|
154
154
|
with_contents = options[:references].length <= 1
|
155
155
|
exit_code = 0
|
156
156
|
require 'puppet/util/reference'
|
157
|
-
options[:references].
|
157
|
+
options[:references].sort_by(&:to_s).each do |name|
|
158
158
|
raise _("Could not find reference %{name}") % { name: name } unless section = Puppet::Util::Reference.reference(name)
|
159
159
|
|
160
160
|
begin
|
@@ -283,7 +283,7 @@ Copyright (c) 2015 Puppet Inc., LLC Licensed under the Apache 2.0 License
|
|
283
283
|
'merge_hash_arrays' => !options[:merge_hash_arrays].nil?}
|
284
284
|
|
285
285
|
if options[:prefix]
|
286
|
-
merge_options
|
286
|
+
merge_options['knockout_prefix'] = options[:prefix]
|
287
287
|
end
|
288
288
|
|
289
289
|
else
|
@@ -209,8 +209,8 @@ Copyright (c) 2017 Puppet Inc., LLC Licensed under the Apache 2.0 License
|
|
209
209
|
|
210
210
|
compiler.compile()
|
211
211
|
|
212
|
-
rescue Puppet::
|
213
|
-
# already logged and handled by the compiler
|
212
|
+
rescue Puppet::Error
|
213
|
+
# already logged and handled by the compiler, including Puppet::ParseErrorWithIssue
|
214
214
|
exit(1)
|
215
215
|
end
|
216
216
|
|
data/lib/puppet/configurer.rb
CHANGED
@@ -144,9 +144,10 @@ class Puppet::Configurer
|
|
144
144
|
facts_hash
|
145
145
|
end
|
146
146
|
|
147
|
-
def prepare_and_retrieve_catalog(options, query_options)
|
147
|
+
def prepare_and_retrieve_catalog(cached_catalog, options, query_options)
|
148
148
|
# set report host name now that we have the fact
|
149
149
|
options[:report].host = Puppet[:node_name_value]
|
150
|
+
|
150
151
|
query_options[:transaction_uuid] = @transaction_uuid
|
151
152
|
query_options[:job_id] = @job_id
|
152
153
|
query_options[:static_catalog] = @static_catalog
|
@@ -156,24 +157,19 @@ class Puppet::Configurer
|
|
156
157
|
query_options[:checksum_type] = @checksum_type.join('.')
|
157
158
|
|
158
159
|
# apply passes in ral catalog
|
159
|
-
catalog = options
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
Puppet.err _("Could not retrieve catalog; skipping run")
|
167
|
-
nil
|
160
|
+
catalog = cached_catalog || options[:catalog]
|
161
|
+
unless catalog
|
162
|
+
# retrieve_catalog returns resource catalog
|
163
|
+
catalog = retrieve_catalog(query_options)
|
164
|
+
Puppet.err _("Could not retrieve catalog; skipping run") unless catalog
|
165
|
+
end
|
166
|
+
catalog
|
168
167
|
end
|
169
168
|
|
170
169
|
def prepare_and_retrieve_catalog_from_cache(options = {})
|
171
170
|
result = retrieve_catalog_from_cache({:transaction_uuid => @transaction_uuid, :static_catalog => @static_catalog})
|
172
|
-
if result
|
173
|
-
|
174
|
-
return convert_catalog(result, @duration, options)
|
175
|
-
end
|
176
|
-
nil
|
171
|
+
Puppet.info _("Using cached catalog from environment '%{catalog_env}'") % { catalog_env: result.environment } if result
|
172
|
+
result
|
177
173
|
end
|
178
174
|
|
179
175
|
# Apply supplied catalog and return associated application report
|
@@ -251,13 +247,12 @@ class Puppet::Configurer
|
|
251
247
|
Puppet::GettextConfig.reset_text_domain('agent')
|
252
248
|
Puppet::ModuleTranslations.load_from_vardir(Puppet[:vardir])
|
253
249
|
|
254
|
-
if
|
255
|
-
options[:catalog] = catalog
|
250
|
+
if cached_catalog = prepare_and_retrieve_catalog_from_cache(options)
|
256
251
|
@cached_catalog_status = 'explicitly_requested'
|
257
252
|
|
258
|
-
if @environment !=
|
259
|
-
Puppet.notice _("Local environment: '%{local_env}' doesn't match the environment of the cached catalog '%{catalog_env}', switching agent to '%{catalog_env}'.") % { local_env: @environment, catalog_env:
|
260
|
-
@environment =
|
253
|
+
if @environment != cached_catalog.environment && !Puppet[:strict_environment_mode]
|
254
|
+
Puppet.notice _("Local environment: '%{local_env}' doesn't match the environment of the cached catalog '%{catalog_env}', switching agent to '%{catalog_env}'.") % { local_env: @environment, catalog_env: cached_catalog.environment }
|
255
|
+
@environment = cached_catalog.environment
|
261
256
|
end
|
262
257
|
|
263
258
|
report.environment = @environment
|
@@ -278,7 +273,7 @@ class Puppet::Configurer
|
|
278
273
|
configured_environment = Puppet[:environment] if Puppet.settings.set_by_config?(:environment)
|
279
274
|
|
280
275
|
# We only need to find out the environment to run in if we don't already have a catalog
|
281
|
-
unless (options[:catalog] || Puppet[:strict_environment_mode])
|
276
|
+
unless (cached_catalog || options[:catalog] || Puppet[:strict_environment_mode])
|
282
277
|
begin
|
283
278
|
node = nil
|
284
279
|
node_retr_time = thinmark do
|
@@ -329,7 +324,7 @@ class Puppet::Configurer
|
|
329
324
|
query_options = get_facts(options) unless query_options
|
330
325
|
query_options[:configured_environment] = configured_environment
|
331
326
|
|
332
|
-
unless catalog = prepare_and_retrieve_catalog(options, query_options)
|
327
|
+
unless catalog = prepare_and_retrieve_catalog(cached_catalog, options, query_options)
|
333
328
|
return nil
|
334
329
|
end
|
335
330
|
|
@@ -354,16 +349,37 @@ class Puppet::Configurer
|
|
354
349
|
query_options = get_facts(options)
|
355
350
|
query_options[:configured_environment] = configured_environment
|
356
351
|
|
357
|
-
|
352
|
+
# if we get here, ignore the cached catalog
|
353
|
+
return nil unless catalog = prepare_and_retrieve_catalog(nil, options, query_options)
|
358
354
|
tries += 1
|
359
355
|
end
|
360
356
|
|
357
|
+
# now that environment has converged, convert resource catalog into ral catalog
|
358
|
+
# unless we were given a RAL catalog
|
359
|
+
if !cached_catalog && options[:catalog]
|
360
|
+
ral_catalog = options[:catalog]
|
361
|
+
else
|
362
|
+
# REMIND @duration is the time spent loading the last catalog, and doesn't
|
363
|
+
# account for things like we failed to download and fell back to the cache
|
364
|
+
ral_catalog = convert_catalog(catalog, @duration, options)
|
365
|
+
|
366
|
+
# If not noop, commit the cached resource catalog (not ral catalog). Ideally
|
367
|
+
# we'd just copy the downloaded response body, instead of serializing the
|
368
|
+
# in-memory catalog, but that's hard due to the indirector.
|
369
|
+
indirection = Puppet::Resource::Catalog.indirection
|
370
|
+
if !Puppet[:noop] && indirection.cache?
|
371
|
+
request = indirection.request(:save, nil, catalog, environment: Puppet::Node::Environment.remote(catalog.environment))
|
372
|
+
Puppet.info("Caching catalog for #{request.key}")
|
373
|
+
indirection.cache.save(request)
|
374
|
+
end
|
375
|
+
end
|
376
|
+
|
361
377
|
execute_prerun_command or return nil
|
362
378
|
|
363
|
-
options[:report].code_id =
|
364
|
-
options[:report].catalog_uuid =
|
379
|
+
options[:report].code_id = ral_catalog.code_id
|
380
|
+
options[:report].catalog_uuid = ral_catalog.catalog_uuid
|
365
381
|
options[:report].cached_catalog_status = @cached_catalog_status
|
366
|
-
apply_catalog(
|
382
|
+
apply_catalog(ral_catalog, options)
|
367
383
|
true
|
368
384
|
rescue => detail
|
369
385
|
Puppet.log_exception(detail, _("Failed to apply catalog: %{detail}") % { detail: detail })
|
@@ -372,6 +388,14 @@ class Puppet::Configurer
|
|
372
388
|
execute_postrun_command or return nil
|
373
389
|
end
|
374
390
|
ensure
|
391
|
+
if Puppet[:resubmit_facts]
|
392
|
+
# TODO: Should mark the report as "failed" if an error occurs and
|
393
|
+
# resubmit_facts returns false. There is currently no API for this.
|
394
|
+
resubmit_facts_time = thinmark { resubmit_facts }
|
395
|
+
|
396
|
+
report.add_times(:resubmit_facts, resubmit_facts_time)
|
397
|
+
end
|
398
|
+
|
375
399
|
report.cached_catalog_status ||= @cached_catalog_status
|
376
400
|
report.add_times(:total, Time.now - start)
|
377
401
|
report.finalize_report
|
@@ -418,6 +442,40 @@ class Puppet::Configurer
|
|
418
442
|
Puppet.log_exception(detail, _("Could not save last run local report: %{detail}") % { detail: detail })
|
419
443
|
end
|
420
444
|
|
445
|
+
# Submit updated facts to the Puppet Server
|
446
|
+
#
|
447
|
+
# This method will clear all current fact values, load a fresh set of
|
448
|
+
# fact data, and then submit it to the Puppet Server.
|
449
|
+
#
|
450
|
+
# @return [true] If fact submission succeeds.
|
451
|
+
# @return [false] If an exception is raised during fact generation or
|
452
|
+
# submission.
|
453
|
+
def resubmit_facts
|
454
|
+
::Facter.clear
|
455
|
+
facts = find_facts
|
456
|
+
|
457
|
+
saved_fact_terminus = Puppet::Node::Facts.indirection.terminus_class
|
458
|
+
begin
|
459
|
+
Puppet::Node::Facts.indirection.terminus_class = :rest
|
460
|
+
|
461
|
+
server = Puppet::Node::Facts::Rest.server
|
462
|
+
Puppet.info(_("Uploading facts for %{node} to %{server}") % {
|
463
|
+
node: facts.name,
|
464
|
+
server: server})
|
465
|
+
|
466
|
+
Puppet::Node::Facts.indirection.save(facts, nil, :environment => Puppet::Node::Environment.remote(@environment))
|
467
|
+
|
468
|
+
return true
|
469
|
+
ensure
|
470
|
+
Puppet::Node::Facts.indirection.terminus_class = saved_fact_terminus
|
471
|
+
end
|
472
|
+
rescue => detail
|
473
|
+
Puppet.log_exception(detail, _("Failed to submit facts: %{detail}") %
|
474
|
+
{ detail: detail })
|
475
|
+
|
476
|
+
return false
|
477
|
+
end
|
478
|
+
|
421
479
|
private
|
422
480
|
|
423
481
|
def execute_from_setting(setting)
|
@@ -456,8 +514,8 @@ class Puppet::Configurer
|
|
456
514
|
Puppet[:node_name_value],
|
457
515
|
query_options.merge(
|
458
516
|
:ignore_cache => true,
|
459
|
-
#
|
460
|
-
:ignore_cache_save =>
|
517
|
+
# don't update cache until after environment converges
|
518
|
+
:ignore_cache_save => true,
|
461
519
|
:environment => Puppet::Node::Environment.remote(@environment),
|
462
520
|
:fail_on_404 => true
|
463
521
|
)
|
@@ -55,12 +55,8 @@ class Puppet::Configurer::Downloader
|
|
55
55
|
:noop => false
|
56
56
|
}
|
57
57
|
if !Puppet.features.microsoft_windows?
|
58
|
-
defargs.
|
59
|
-
|
60
|
-
:owner => Process.uid,
|
61
|
-
:group => Process.gid
|
62
|
-
}
|
63
|
-
)
|
58
|
+
defargs[:owner] = Process.uid
|
59
|
+
defargs[:group] = Process.gid
|
64
60
|
end
|
65
61
|
return defargs
|
66
62
|
end
|
data/lib/puppet/defaults.rb
CHANGED
@@ -180,12 +180,19 @@ module Puppet
|
|
180
180
|
:trace => {
|
181
181
|
:default => false,
|
182
182
|
:type => :boolean,
|
183
|
-
:desc => "Whether to print stack traces on some errors
|
183
|
+
:desc => "Whether to print stack traces on some errors. Will print
|
184
|
+
internal Ruby stack trace interleaved with Puppet function frames.",
|
184
185
|
:hook => proc do |value|
|
185
186
|
# Enable or disable Facter's trace option too
|
186
187
|
Facter.trace(value) if Facter.respond_to? :trace
|
187
188
|
end
|
188
189
|
},
|
190
|
+
:puppet_trace => {
|
191
|
+
:default => false,
|
192
|
+
:type => :boolean,
|
193
|
+
:desc => "Whether to print the Puppet stack trace on some errors.
|
194
|
+
This is a noop if `trace` is also set.",
|
195
|
+
},
|
189
196
|
:profile => {
|
190
197
|
:default => false,
|
191
198
|
:type => :boolean,
|
@@ -524,9 +531,10 @@ module Puppet
|
|
524
531
|
},
|
525
532
|
:http_proxy_host => {
|
526
533
|
:default => "none",
|
527
|
-
:desc => "The HTTP proxy host to use for outgoing connections.
|
534
|
+
:desc => "The HTTP proxy host to use for outgoing connections. The proxy will be bypassed if
|
535
|
+
the server's hostname matches the NO_PROXY environment variable or `no_proxy` setting. Note: You
|
528
536
|
may need to use a FQDN for the server hostname when using a proxy. Environment variable
|
529
|
-
http_proxy or HTTP_PROXY will override this value",
|
537
|
+
http_proxy or HTTP_PROXY will override this value. ",
|
530
538
|
},
|
531
539
|
:http_proxy_port => {
|
532
540
|
:default => 3128,
|
@@ -552,7 +560,7 @@ module Puppet
|
|
552
560
|
},
|
553
561
|
:no_proxy => {
|
554
562
|
:default => "localhost, 127.0.0.1",
|
555
|
-
:desc => "List of domain names that should not go through `http_proxy_host`. Environment variable no_proxy or NO_PROXY will override this value.",
|
563
|
+
:desc => "List of host or domain names that should not go through `http_proxy_host`. Environment variable no_proxy or NO_PROXY will override this value. Names can be specified as an FQDN `host.example.com`, wildcard `*.example.com`, dotted domain `.example.com`, or suffix `example.com`.",
|
556
564
|
},
|
557
565
|
:http_keepalive_timeout => {
|
558
566
|
:default => "4s",
|
@@ -1730,6 +1738,11 @@ EOT
|
|
1730
1738
|
:type => :boolean,
|
1731
1739
|
:desc => "Whether to send reports after every transaction.",
|
1732
1740
|
},
|
1741
|
+
:resubmit_facts => {
|
1742
|
+
:default => false,
|
1743
|
+
:type => :boolean,
|
1744
|
+
:desc => "Whether to send updated facts after every transaction.",
|
1745
|
+
},
|
1733
1746
|
:lastrunfile => {
|
1734
1747
|
:default => "$statedir/last_run_summary.yaml",
|
1735
1748
|
:type => :file,
|
data/lib/puppet/error.rb
CHANGED
@@ -12,7 +12,7 @@ module Puppet
|
|
12
12
|
# This module implements logging with a filename and line number. Use this
|
13
13
|
# for errors that need to report a location in a non-ruby file that we
|
14
14
|
# parse.
|
15
|
-
attr_accessor :line, :file, :pos
|
15
|
+
attr_accessor :line, :file, :pos, :puppetstack
|
16
16
|
|
17
17
|
# May be called with 3 arguments for message, file, line, and exception, or
|
18
18
|
# 4 args including the position on the line.
|
@@ -22,10 +22,18 @@ module Puppet
|
|
22
22
|
original = pos
|
23
23
|
pos = nil
|
24
24
|
end
|
25
|
+
|
25
26
|
super(message, original)
|
27
|
+
|
26
28
|
@file = file unless (file.is_a?(String) && file.empty?)
|
27
29
|
@line = line
|
28
30
|
@pos = pos
|
31
|
+
|
32
|
+
if original && original.respond_to?(:puppetstack)
|
33
|
+
@puppetstack = original.puppetstack
|
34
|
+
else
|
35
|
+
@puppetstack = Puppet::Pops::PuppetStack.stacktrace()
|
36
|
+
end
|
29
37
|
end
|
30
38
|
|
31
39
|
def to_s
|
data/lib/puppet/face/ca.rb
CHANGED
@@ -93,7 +93,7 @@ Puppet::Face.define(:ca, '0.1.0') do
|
|
93
93
|
ca.verify(host.name)
|
94
94
|
"+ #{name} #{host.certificate.digest(options[:digest])}"
|
95
95
|
rescue Puppet::SSL::CertificateAuthority::CertificateVerificationError => e
|
96
|
-
"- #{name} #{host.certificate.digest(options[:digest])} (#{e
|
96
|
+
"- #{name} #{host.certificate.digest(options[:digest])} (#{e})"
|
97
97
|
end
|
98
98
|
end
|
99
99
|
end.join("\n")
|
@@ -128,10 +128,10 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
128
128
|
unmet_grouped.each do |type, deps|
|
129
129
|
unless deps.empty?
|
130
130
|
unmet_grouped[type].sort_by { |dep| dep[:name] }.each do |dep|
|
131
|
-
dep_name = dep[:name].
|
131
|
+
dep_name = dep[:name].tr('/', '-')
|
132
132
|
installed_version = dep[:mod_details][:installed_version]
|
133
133
|
version_constraint = dep[:version_constraint]
|
134
|
-
parent_name = dep[:parent][:name].
|
134
|
+
parent_name = dep[:parent][:name].tr('/', '-')
|
135
135
|
parent_version = dep[:parent][:version]
|
136
136
|
|
137
137
|
msg = _("'%{parent_name}' (%{parent_version}) requires '%{dependency_name}' (%{dependency_version})") % { parent_name: parent_name, parent_version: parent_version, dependency_name: dep_name, dependency_version: version_constraint }
|
@@ -151,7 +151,7 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
151
151
|
error_display_order.each do |type|
|
152
152
|
unless @unmet_deps[type].empty?
|
153
153
|
@unmet_deps[type].keys.sort.each do |dep|
|
154
|
-
name = dep.
|
154
|
+
name = dep.tr('/', '-')
|
155
155
|
errors = @unmet_deps[type][dep][:errors]
|
156
156
|
version = @unmet_deps[type][dep][:version]
|
157
157
|
|
@@ -219,7 +219,7 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
219
219
|
dep[:reason] == :missing
|
220
220
|
end
|
221
221
|
missing_deps.map do |mis_mod|
|
222
|
-
str = "#{colorize(:bg_red, _('UNMET DEPENDENCY'))} #{mis_mod[:name].
|
222
|
+
str = "#{colorize(:bg_red, _('UNMET DEPENDENCY'))} #{mis_mod[:name].tr('/', '-')} "
|
223
223
|
str << "(#{colorize(:cyan, mis_mod[:version_constraint])})"
|
224
224
|
node[:dependencies] << { :text => str }
|
225
225
|
end
|
@@ -244,7 +244,7 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
244
244
|
#
|
245
245
|
def list_build_node(mod, parent, params)
|
246
246
|
str = ''
|
247
|
-
str << (mod.forge_name ? mod.forge_name.
|
247
|
+
str << (mod.forge_name ? mod.forge_name.tr('/', '-') : mod.name)
|
248
248
|
str << ' (' + colorize(:cyan, mod.version ? "v#{mod.version}" : '???') + ')'
|
249
249
|
|
250
250
|
unless File.dirname(mod.path) == params[:path]
|
@@ -81,7 +81,7 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
81
81
|
|
82
82
|
highlight = proc do |s|
|
83
83
|
s = s.gsub(term, colorize(:green, term))
|
84
|
-
s = s.gsub(term.
|
84
|
+
s = s.gsub(term.tr('/', '-'), colorize(:green, term.tr('/', '-'))) if term =~ /\//
|
85
85
|
s = s.gsub(' DEPRECATED', colorize(:red, ' DEPRECATED'))
|
86
86
|
s
|
87
87
|
end
|
@@ -67,7 +67,7 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
67
67
|
end
|
68
68
|
|
69
69
|
when_invoked do |name, options|
|
70
|
-
name = name.
|
70
|
+
name = name.tr('/', '-')
|
71
71
|
Puppet.notice _("Preparing to upgrade '%{name}' ...") % { name: name }
|
72
72
|
Puppet::ModuleTool.set_option_defaults options
|
73
73
|
Puppet::ModuleTool::Applications::Upgrader.new(name, options).run
|
@@ -40,7 +40,7 @@ class Puppet::FileServing::HttpMetadata < Puppet::FileServing::Metadata
|
|
40
40
|
[ @checksum_type, :md5, :sha256, :sha384, :sha512, :sha224, :mtime ].each do |type|
|
41
41
|
@checksum_type = type
|
42
42
|
@checksum = @checksums[type]
|
43
|
-
|
43
|
+
break if @checksum
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
data/lib/puppet/file_system.rb
CHANGED
@@ -89,14 +89,6 @@ module Puppet::FileSystem
|
|
89
89
|
@impl.path_string(@impl.basename(assert_path(path)))
|
90
90
|
end
|
91
91
|
|
92
|
-
# @return [Integer] the size of the file
|
93
|
-
#
|
94
|
-
# @api public
|
95
|
-
#
|
96
|
-
def self.size(path)
|
97
|
-
@impl.size(assert_path(path))
|
98
|
-
end
|
99
|
-
|
100
92
|
# Allows exclusive updates to a file to be made by excluding concurrent
|
101
93
|
# access using flock. This means that if the file is on a filesystem that
|
102
94
|
# does not support flock, this method will provide no protection.
|
@@ -14,11 +14,12 @@ class Puppet::FileSystem::Posix < Puppet::FileSystem::FileImpl
|
|
14
14
|
bsize = stream_blksize(this, stream)
|
15
15
|
sa = "".force_encoding('ASCII-8BIT')
|
16
16
|
sb = "".force_encoding('ASCII-8BIT')
|
17
|
-
|
17
|
+
loop do
|
18
18
|
this.read(bsize, sa)
|
19
19
|
stream.read(bsize, sb)
|
20
20
|
return true if sa.empty? && sb.empty?
|
21
|
-
|
21
|
+
break if sa != sb
|
22
|
+
end
|
22
23
|
false
|
23
24
|
end
|
24
25
|
end
|