Skip to content

Commit

Permalink
Use heredoc now that we can count on Ruby 2.3+
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Jan 27, 2024
1 parent 98e717d commit 6c55a3a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/beaker/hypervisor/vagrant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,8 @@ def provision(provider = nil)
# make sure that any old boxes are dead dead dead
begin
vagrant_cmd('destroy --force') if File.file?(@vagrant_file)
rescue RuntimeError => e
# LATER: use <<~MESSAGE once we're on Ruby 2.3
@logger.debug(%(
rescue

Check failure on line 231 in lib/beaker/hypervisor/vagrant.rb

View workflow job for this annotation

GitHub Actions / rubocop

Style/RescueStandardError: Avoid rescuing without specifying an error class.
@logger.debug <<~MESSAGE
Beaker failed to destroy the existing VM's. If you think this is
an error or you upgraded from an older version of beaker try
verifying the VM exists and deleting the existing Vagrantfile if
Expand All @@ -240,8 +239,8 @@ def provision(provider = nil)
vagrant status
vagrant destroy # only need to run this is a VM is not created
rm #{@vagrant_file} # only do this if all VM's are actually destroyed
).each_line.map(&:strip).join("\n"))
raise e
MESSAGE
raise
end

make_vfile @hosts, @options
Expand Down

0 comments on commit 6c55a3a

Please sign in to comment.