Skip to content

Commit 4860fcc

Browse files
committed
Prefer value of :facts to value of :fact_file
1 parent 9780baf commit 4860fcc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: lib/octocatalog-diff/catalog-util/builddir.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ def install_fact_file(logger, options)
149149
raise ArgumentError, 'Called install_fact_file without node, or with an empty node'
150150
end
151151

152-
facts = if options[:fact_file]
152+
facts = if options[:facts].is_a?(OctocatalogDiff::Facts)
153+
options[:facts].dup
154+
elsif options[:fact_file]
153155
raise Errno::ENOENT, "Fact file #{options[:fact_file]} does not exist" unless File.file?(options[:fact_file])
154156
fact_file_opts = { fact_file_string: File.read(options[:fact_file]) }
155157
fact_file_opts[:backend] = Regexp.last_match(1).to_sym if options[:fact_file] =~ /.*\.(\w+)$/
156158
OctocatalogDiff::Facts.new(fact_file_opts)
157-
elsif options[:facts].is_a?(OctocatalogDiff::Facts)
158-
options[:facts].dup
159159
else
160160
raise ArgumentError, 'No facts passed to "install_fact_file" method'
161161
end

0 commit comments

Comments
 (0)