while loop code formating

This commit is contained in:
Arvind Tiwari 2017-09-15 00:14:09 +05:30
parent 8393afe141
commit a1a90ed5d0

View file

@ -968,14 +968,16 @@ class VirtualMachineView(LoginRequiredMixin, View):
# )
t = 0
while True:
if t > 150:
break
try:
manager.get_vm(self.kwargs.get('pk'))
except BaseException:
break
if t < 150:
t += 1
try:
manager.get_vm(self.kwargs.get('pk'))
except BaseException:
break
else:
sleep(2)
else:
sleep(2)
break
response['status'] = True
response['redirect'] = self.get_success_url()