Skip to content

Commit 9b390bc

Browse files
authored
Merge pull request #8563 from luchihoratiu/maint-puppet_fact_diff
(maint) Retrieve only stdout for `puppet facts diff`
2 parents 43925e1 + 44c56ee commit 9b390bc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/puppet/face/facts.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@
141141
puppet_show_cmd = "ruby -S -- #{puppet_show_cmd}"
142142
end
143143

144-
facter_3_result = Puppet::Util::Execution.execute("#{puppet_show_cmd} --no-facterng #{cmd_flags}")
145-
facter_ng_result = Puppet::Util::Execution.execute("#{puppet_show_cmd} --facterng #{cmd_flags}")
144+
facter_3_result = Puppet::Util::Execution.execute("#{puppet_show_cmd} --no-facterng #{cmd_flags}", combine: false)
145+
facter_ng_result = Puppet::Util::Execution.execute("#{puppet_show_cmd} --facterng #{cmd_flags}", combine: false)
146146

147147
exclude_list = options[:exclude].nil? ? EXCLUDE_LIST : EXCLUDE_LIST + [ options[:exclude] ]
148148
fact_diff = FactDif.new(facter_3_result, facter_ng_result, exclude_list, options[:structured])

spec/unit/application/facts_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@
191191
app.command_line.args = %w{diff}
192192

193193
allow(Facter).to receive(:value).with('facterversion').and_return('3.99.0')
194-
allow(Puppet::Util::Execution).to receive(:execute).with(/puppet facts show --no-facterng/).and_return(facter3_facts)
195-
allow(Puppet::Util::Execution).to receive(:execute).with(/puppet facts show --facterng/).and_return(facter4_facts)
194+
allow(Puppet::Util::Execution).to receive(:execute).with(/puppet facts show --no-facterng/, combine:false).and_return(facter3_facts)
195+
allow(Puppet::Util::Execution).to receive(:execute).with(/puppet facts show --facterng/, combine:false).and_return(facter4_facts)
196196
end
197197

198198
# Workaround for YAML issue on Ubuntu where null values get space as key

0 commit comments

Comments
 (0)