Skip to content

Commit

Permalink
Merge pull request #9310 from puppetlabs/backport-9288-to-7.x
Browse files Browse the repository at this point in the history
[Backport 7.x] (PUP-12023) Add option for disabling catalog messages
  • Loading branch information
joshcooper authored Apr 2, 2024
2 parents 40d8dbf + 8a37f4f commit 4bb2994
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions lib/puppet/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ def self.initialize_default_settings!(settings)
end
end
},
:skip_logging_catalog_request_destination => {
:default => false,
:type => :boolean,
:desc => "If you wish to suppress the notice of which compiler supplied the
catalog",
},
:merge_dependency_warnings => {
:default => false,
:type => :boolean,
Expand Down
12 changes: 7 additions & 5 deletions lib/puppet/indirector/catalog/rest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ def find(request)
session = Puppet.lookup(:http_session)
api = session.route_to(:puppet)

ip_address = begin
" (#{Resolv.getaddress(api.url.host)})"
rescue Resolv::ResolvError
nil
unless Puppet.settings[:skip_logging_catalog_request_destination]
ip_address = begin
" (#{Resolv.getaddress(api.url.host)})"
rescue Resolv::ResolvError
nil
end
Puppet.notice("Requesting catalog from #{api.url.host}:#{api.url.port}#{ip_address}")
end
Puppet.notice("Requesting catalog from #{api.url.host}:#{api.url.port}#{ip_address}")

_, catalog = api.post_catalog(
request.key,
Expand Down

0 comments on commit 4bb2994

Please sign in to comment.