1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Refactoring

This commit is contained in:
Retspen 2015-02-27 11:51:33 +02:00
parent dd5f98cbe8
commit fa3df5bff3
6 changed files with 73 additions and 72 deletions

View file

@ -28,8 +28,9 @@ def instances(request):
if not request.user.is_authenticated():
return HttpResponseRedirect(reverse('index'))
computes = Compute.objects.filter()
error_messages = []
all_host_vms = {}
computes = Compute.objects.filter()
for compute in computes:
if connection_manager.host_is_up(compute.type, compute.hostname):
@ -37,8 +38,8 @@ def instances(request):
conn = wvmHostDetails(compute, compute.login, compute.password, compute.type)
all_host_vms[compute.id, compute.name] = conn.get_host_instances()
conn.close()
except libvirtError:
pass
except libvirtError as lib_err:
error_messages.append(lib_err)
return render(request, 'instances.html', locals())