File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 133
133
134
134
if Puppet ::Util ::Package . versioncmp ( Facter . value ( 'facterversion' ) , '4.0.0' ) < 0
135
135
facter3_result = Puppet ::Node ::Facts . indirection . find ( Puppet . settings [ :certname ] )
136
- begin
137
- require 'facter-ng'
138
- facter4_result = Puppet :: Node :: Facts . indirection . find ( Puppet . settings [ :certname ] )
139
- rescue LoadError
140
- raise ArgumentError , 'facter-ng could not be loaded'
136
+
137
+ # puppet/ruby are in PATH since it was updated in the wrapper script
138
+ puppet_cmd = 'puppet facts show --facterng --render-as json'
139
+ if Puppet :: Util :: Platform . windows?
140
+ puppet_cmd = "ruby -S -- puppet facts show --render-as json"
141
141
end
142
- fact_diff = FactDif . new ( facter3_result . to_json , facter4_result . to_json , EXCLUDE_LIST )
142
+ facter4_result = Puppet ::Util ::Execution . execute ( puppet_cmd )
143
+
144
+ fact_diff = FactDif . new ( facter3_result . to_json , facter4_result , EXCLUDE_LIST )
143
145
fact_diff . difs
144
146
else
145
147
Puppet . warning _ ( "Already using Facter 4. To use `puppet facts diff` remove facterng from the .conf file or run `puppet config set facterng false`." )
You can’t perform that action at this time.
0 commit comments