Skip to content

Commit

Permalink
Check for empty inventory file
Browse files Browse the repository at this point in the history
  • Loading branch information
sooyean-hoo committed Aug 19, 2024
1 parent 8467fc6 commit 7f17c37
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/support/acceptance/vhelper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,18 @@ module LitmusHelpers
else
abort 'error: could not execute command'
end

inventoryfile='./spec/fixtures/litmus_inventory.yaml'
invcontent = ''
if File.exists?(inventoryfile)
File.open(inventoryfile, 'r') do |f|
f.each_line do |line|
invcontent += line unless %r{^[ ]*#}.match?(line)
end
end
puts "===Actual=Contents=#{inventoryfile}===\n#{invcontent}"
end
exit 404 if invcontent.empty?
end

desc 'Install Puppet agent'
Expand Down

0 comments on commit 7f17c37

Please sign in to comment.