diff options
| author | Armando Migliaccio <armando.migliaccio@citrix.com> | 2010-11-22 13:11:00 +0000 |
|---|---|---|
| committer | Armando Migliaccio <armando.migliaccio@citrix.com> | 2010-11-22 13:11:00 +0000 |
| commit | 958591ab2996443ffb6d2f92f928eaad277aa2db (patch) | |
| tree | 0541ed223b7c5088ad15a95a813589dbc7d7f62a | |
| parent | 96b42bc9cd759e8cc0d515472a717e98c3052410 (diff) | |
| download | nova-958591ab2996443ffb6d2f92f928eaad277aa2db.tar.gz nova-958591ab2996443ffb6d2f92f928eaad277aa2db.tar.xz nova-958591ab2996443ffb6d2f92f928eaad277aa2db.zip | |
pep8 violations fix
| -rw-r--r-- | nova/virt/xenapi.py | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/nova/virt/xenapi.py b/nova/virt/xenapi.py index c3a0c2c7a..3169562a5 100644 --- a/nova/virt/xenapi.py +++ b/nova/virt/xenapi.py @@ -338,28 +338,27 @@ class XenAPIConnection(object): @utils.deferredToThread def _lookup_vm_vdis(self, vm): return self._lookup_vm_vdis_blocking(vm) - + def _lookup_vm_vdis_blocking(self, vm): # Firstly we get the VBDs, then the VDIs. # TODO: do we leave the read-only devices? vbds = self._conn.xenapi.VM.get_VBDs(vm) vdis = [] if vbds: - for vbd in vbds: - try: - vdi = self._conn.xenapi.VBD.get_VDI(vbd) - # Test valid VDI - record = self._conn.xenapi.VDI.get_record(vdi) - except Exception, exc: - logging.warn(exc) - else: - vdis.append(vdi) - if len(vdis) > 0: - return vdis - else: - return None - - + for vbd in vbds: + try: + vdi = self._conn.xenapi.VBD.get_VDI(vbd) + # Test valid VDI + record = self._conn.xenapi.VDI.get_record(vdi) + except Exception, exc: + logging.warn(exc) + else: + vdis.append(vdi) + if len(vdis) > 0: + return vdis + else: + return None + def _wait_for_task(self, task): """Return a Deferred that will give the result of the given task. The task is polled until it completes.""" |
