mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
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:
parent
7657ec127c
commit
0b841d63fd
2 changed files with 9 additions and 9 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue