catching WrongIdError
This commit is contained in:
parent
9c0cefd419
commit
d49e90bd20
1 changed files with 4 additions and 1 deletions
|
@ -972,10 +972,13 @@ class VirtualMachineView(LoginRequiredMixin, View):
|
||||||
for t in range(15):
|
for t in range(15):
|
||||||
try:
|
try:
|
||||||
manager.get_vm(self.kwargs.get('pk'))
|
manager.get_vm(self.kwargs.get('pk'))
|
||||||
except BaseException:
|
except WrongIdError:
|
||||||
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')
|
||||||
|
self.send_mail()
|
||||||
|
break
|
||||||
|
except BaseException:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
sleep(2)
|
sleep(2)
|
||||||
|
|
Loading…
Reference in a new issue