File tree 1 file changed +3
-3
lines changed
lib/octocatalog-diff/catalog-util
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -149,13 +149,13 @@ def install_fact_file(logger, options)
149
149
raise ArgumentError , 'Called install_fact_file without node, or with an empty node'
150
150
end
151
151
152
- facts = if options [ :fact_file ]
152
+ facts = if options [ :facts ] . is_a? ( OctocatalogDiff ::Facts )
153
+ options [ :facts ] . dup
154
+ elsif options [ :fact_file ]
153
155
raise Errno ::ENOENT , "Fact file #{ options [ :fact_file ] } does not exist" unless File . file? ( options [ :fact_file ] )
154
156
fact_file_opts = { fact_file_string : File . read ( options [ :fact_file ] ) }
155
157
fact_file_opts [ :backend ] = Regexp . last_match ( 1 ) . to_sym if options [ :fact_file ] =~ /.*\. (\w +)$/
156
158
OctocatalogDiff ::Facts . new ( fact_file_opts )
157
- elsif options [ :facts ] . is_a? ( OctocatalogDiff ::Facts )
158
- options [ :facts ] . dup
159
159
else
160
160
raise ArgumentError , 'No facts passed to "install_fact_file" method'
161
161
end
You can’t perform that action at this time.
0 commit comments