diff --git a/lib/beaker/hypervisor/vagrant.rb b/lib/beaker/hypervisor/vagrant.rb index 6629a2e..2be30be 100644 --- a/lib/beaker/hypervisor/vagrant.rb +++ b/lib/beaker/hypervisor/vagrant.rb @@ -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 + @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 @@ -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