Remove unnecessary rescue

This commit removes an unnecessary rescue that results in duplicate clone error messages. Without this change clone failures due to unavailable host resources are logged twice. A log message is added to specify the host the VM is running on when migration_limit is not set and migration is disabled. Lastly, when a migration fails it reports the host the VM is running on in addition to the reason for the failed migration.
This commit is contained in:
kirby@puppetlabs.com 2017-11-06 11:24:35 -08:00 committed by mattkirby
parent 82b9033e83
commit 048ab4433a
2 changed files with 26 additions and 23 deletions

View file

@ -224,10 +224,9 @@ module Vmpooler
$logger.log('s', "[+] [#{pool_name}] '#{new_vmname}' cloned in #{finish} seconds")
$metrics.timing("clone.#{pool_name}", finish)
rescue => err
$logger.log('s', "[!] [#{pool_name}] '#{new_vmname}' clone failed with an error: #{err}")
rescue => _err
$redis.srem('vmpooler__pending__' + pool_name, new_vmname)
raise
raise _err
ensure
$redis.decr('vmpooler__tasks__clone')
end
@ -712,9 +711,6 @@ module Vmpooler
end
pool_check_response
rescue => err
$logger.log('d', "[!] [#{pool['name']}] _check_pool failed with an error: #{err}")
raise
end
# Create a provider object, usually based on the providers/*.rb class, that implements providers/base.rb