mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-02-14 14:01:51 +00:00
Merge pull request #35 from MasterChief-John-117/fix-templates
Increase timeout and fix infinite loop if starrs delete fails
This commit is contained in:
commit
f734894dbc
1 changed files with 5 additions and 2 deletions
|
@ -99,7 +99,10 @@ def delete_vm_task(vmid):
|
||||||
while retry < 3:
|
while retry < 3:
|
||||||
try:
|
try:
|
||||||
delete_starrs(starrs, vm.name)
|
delete_starrs(starrs, vm.name)
|
||||||
|
break
|
||||||
except:
|
except:
|
||||||
|
retry += 1
|
||||||
|
time.sleep(3)
|
||||||
continue
|
continue
|
||||||
if vm.status != 'stopped':
|
if vm.status != 'stopped':
|
||||||
vm.stop()
|
vm.stop()
|
||||||
|
@ -167,12 +170,12 @@ def setup_template_task(template_id, name, user, ssh_key, cores, memory):
|
||||||
logging.info(
|
logging.info(
|
||||||
'[{}] Waiting until Proxmox is done provisioning.'.format(name))
|
'[{}] Waiting until Proxmox is done provisioning.'.format(name))
|
||||||
set_job_status(job, 'waiting for Proxmox')
|
set_job_status(job, 'waiting for Proxmox')
|
||||||
timeout = 20
|
timeout = 25
|
||||||
retry = 0
|
retry = 0
|
||||||
while retry < timeout:
|
while retry < timeout:
|
||||||
if not VM(vmid).is_provisioned():
|
if not VM(vmid).is_provisioned():
|
||||||
retry += 1
|
retry += 1
|
||||||
time.sleep(6)
|
time.sleep(12)
|
||||||
continue
|
continue
|
||||||
break
|
break
|
||||||
if retry == timeout:
|
if retry == timeout:
|
||||||
|
|
Loading…
Reference in a new issue