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 t = 0
while True: while True:
if t > 150: if t < 150:
break t += 1
try: try:
manager.get_vm(self.kwargs.get('pk')) manager.get_vm(self.kwargs.get('pk'))
except BaseException: except BaseException:
break break
else: else:
sleep(2) sleep(2)
else:
break
response['status'] = True response['status'] = True
response['redirect'] = self.get_success_url() response['redirect'] = self.get_success_url()