mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-27 02:18:41 -05:00
(POOLER-47) Update rescue location for clone_vm
This commit shifts the rescue block for clone_vm to ensure it is reached when a failure occurs. Without this change the rescue block may be skipped and cause vmpooler__tasks__clone to not decr, which in turn causes clone operations to stop.
This commit is contained in:
parent
1bbd623609
commit
133bf7eb12
1 changed files with 78 additions and 80 deletions
|
|
@ -187,7 +187,6 @@ module Vmpooler
|
|||
# Clone a VM
|
||||
def clone_vm(template, folder, datastore, target, vsphere)
|
||||
Thread.new do
|
||||
begin
|
||||
vm = {}
|
||||
|
||||
if template =~ /\//
|
||||
|
|
@ -277,12 +276,11 @@ module Vmpooler
|
|||
$redis.decr('vmpooler__tasks__clone')
|
||||
|
||||
$metrics.timing("clone.#{vm['template']}", finish)
|
||||
end
|
||||
rescue => err
|
||||
$logger.log('s', "[!] [#{vm['template']}] '#{vm['hostname']}' failed while preparing to clone with an error: #{err}")
|
||||
raise
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Destroy a VM
|
||||
def destroy_vm(vm, pool, vsphere)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue