error fix on termination
This commit is contained in:
parent
abc290de61
commit
a808f3bf7e
1 changed files with 9 additions and 5 deletions
|
@ -965,13 +965,17 @@ class VirtualMachineView(LoginRequiredMixin, View):
|
||||||
# _('VM %(VM_ID)s terminated successfully') % {
|
# _('VM %(VM_ID)s terminated successfully') % {
|
||||||
# 'VM_ID': opennebula_vm_id}
|
# 'VM_ID': opennebula_vm_id}
|
||||||
# )
|
# )
|
||||||
deleting = True
|
|
||||||
t = 0
|
t = 0
|
||||||
while deleting:
|
while True:
|
||||||
if t < 150 and manager.get_vm(self.kwargs.get('pk')):
|
if t > 150:
|
||||||
sleep(2)
|
break
|
||||||
|
try:
|
||||||
|
manager.get_vm(self.kwargs.get('pk'))
|
||||||
|
except:
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
deleting = False
|
sleep(2)
|
||||||
|
|
||||||
response['status'] = True
|
response['status'] = True
|
||||||
response['redirect'] = self.get_success_url()
|
response['redirect'] = self.get_success_url()
|
||||||
response['text'] = ugettext('Terminated')
|
response['text'] = ugettext('Terminated')
|
||||||
|
|
Loading…
Reference in a new issue