Do not save exception in a variable if it isn't referenced

Prior to this commit there were a couple locations where exceptions were
saved to `_e` but weren't used in the handler except to re-raise the
exception, which simply calling the `raise` keyword will do without a
provided argument.
This commit removes the unnecessary assignment of the exception to a
variable and simply uses `raise` instead.
This commit is contained in:
Brandon High 2020-03-05 14:44:23 -08:00
parent 7657ec127c
commit 0b841d63fd
No known key found for this signature in database
GPG key ID: 270079C784FCAFDE
2 changed files with 9 additions and 9 deletions

View file

@ -330,11 +330,11 @@ module Vmpooler
$logger.log('s', "[+] [#{pool_name}] '#{new_vmname}' cloned in #{finish} seconds")
$metrics.timing("clone.#{pool_name}", finish)
rescue StandardError => _e
rescue StandardError
$redis.srem("vmpooler__pending__#{pool_name}", new_vmname)
expiration_ttl = $config[:redis]['data_ttl'].to_i * 60 * 60
$redis.expire("vmpooler__vm__#{new_vmname}", expiration_ttl)
raise _e
raise
ensure
$redis.decr('vmpooler__tasks__clone')
end
@ -1153,7 +1153,7 @@ module Vmpooler
begin
inventory = create_inventory(pool, provider, pool_check_response)
rescue StandardError => e
rescue StandardError
return(pool_check_response)
end