exception handling fix

This commit is contained in:
Arvind Tiwari 2017-09-21 02:26:42 +05:30
parent f4766c7d7c
commit 1eff51099c

View file

@ -967,11 +967,8 @@ class VirtualMachineView(LoginRequiredMixin, View):
try: try:
vm_data = VirtualMachineSerializer(manager.get_vm(vm.id)).data vm_data = VirtualMachineSerializer(manager.get_vm(vm.id)).data
except BaseException: except WrongIdError:
return redirect( return redirect(reverse('hosting:virtual_machines'))
reverse('hosting:virtual_machines',
kwargs={'pk': opennebula_vm_id})
)
terminated = manager.delete_vm(vm.id) terminated = manager.delete_vm(vm.id)