Skip to content

Commit 3209b3d

Browse files
(PUP-12046) Send facts for catalog download WIP
1 parent 7739378 commit 3209b3d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/puppet/face/catalog.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,11 @@
135135
when_invoked do |_options|
136136
Puppet::Resource::Catalog.indirection.terminus_class = :rest
137137
Puppet::Resource::Catalog.indirection.cache_class = nil
138+
facts = Puppet::Face[:facts, '0.0.1'].find(Puppet[:certname])
138139
catalog = nil
139140
retrieval_duration = thinmark do
140-
catalog = Puppet::Face[:catalog, '0.0.1'].find(Puppet[:certname])
141+
catalog = Puppet::Face[:catalog, '0.0.1'].find(Puppet[:certname],
142+
{ facts_for_catalog: facts })
141143
end
142144
catalog.retrieval_duration = retrieval_duration
143145
catalog.write_class_file

lib/puppet/indirector/face.rb

+5-2
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,17 @@ def call_indirection_method(method, key, options)
6565
action :find do
6666
summary _("Retrieve an object by name.")
6767
arguments _("[<key>]")
68+
option("--facts_for_catalog") do
69+
summary _("Internal option for find to allow facts to be sent for the catalog")
70+
end
6871
when_invoked do |*args|
6972
# Default the key to Puppet[:certname] if none is supplied
7073
if args.length == 1
7174
key = Puppet[:certname]
7275
else
73-
key = args.first
76+
key = args.shift
7477
end
75-
call_indirection_method :find, key, {}
78+
call_indirection_method :find, key, args.first
7679
end
7780
end
7881

0 commit comments

Comments
 (0)