Skip to content

Commit 4bb2994

Browse files
authored
Merge pull request #9310 from puppetlabs/backport-9288-to-7.x
[Backport 7.x] (PUP-12023) Add option for disabling catalog messages
2 parents 40d8dbf + 8a37f4f commit 4bb2994

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

lib/puppet/defaults.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ def self.initialize_default_settings!(settings)
170170
end
171171
end
172172
},
173+
:skip_logging_catalog_request_destination => {
174+
:default => false,
175+
:type => :boolean,
176+
:desc => "If you wish to suppress the notice of which compiler supplied the
177+
catalog",
178+
},
173179
:merge_dependency_warnings => {
174180
:default => false,
175181
:type => :boolean,

lib/puppet/indirector/catalog/rest.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ def find(request)
1414
session = Puppet.lookup(:http_session)
1515
api = session.route_to(:puppet)
1616

17-
ip_address = begin
18-
" (#{Resolv.getaddress(api.url.host)})"
19-
rescue Resolv::ResolvError
20-
nil
17+
unless Puppet.settings[:skip_logging_catalog_request_destination]
18+
ip_address = begin
19+
" (#{Resolv.getaddress(api.url.host)})"
20+
rescue Resolv::ResolvError
21+
nil
22+
end
23+
Puppet.notice("Requesting catalog from #{api.url.host}:#{api.url.port}#{ip_address}")
2124
end
22-
Puppet.notice("Requesting catalog from #{api.url.host}:#{api.url.port}#{ip_address}")
2325

2426
_, catalog = api.post_catalog(
2527
request.key,

0 commit comments

Comments
 (0)