summaryrefslogtreecommitdiffstats
path: root/nova/virt
diff options
context:
space:
mode:
authorCerberus <matt.dietz@rackspace.com>2011-02-18 16:13:34 -0600
committerCerberus <matt.dietz@rackspace.com>2011-02-18 16:13:34 -0600
commita43c5929de7ebf58eb9ecb8416ce3cf4194c176a (patch)
treea572833216fa6394b8b647f0064db198ef2b404a /nova/virt
parent62b3eb71384581e900b061e65caa6418c4452fa9 (diff)
Pep8 cleanup
Diffstat (limited to 'nova/virt')
-rw-r--r--nova/virt/xenapi/vm_utils.py13
-rw-r--r--nova/virt/xenapi/vmops.py5
-rw-r--r--nova/virt/xenapi_conn.py6
3 files changed, 11 insertions, 13 deletions
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
index 91e7339b1..436c88023 100644
--- a/nova/virt/xenapi/vm_utils.py
+++ b/nova/virt/xenapi/vm_utils.py
@@ -256,21 +256,18 @@ class VMHelper(HelperBase):
else:
num_vdis = len(vdi_refs)
if num_vdis != 1:
- raise Exception(_("Unexpected number of VDIs (%(num_vdis)s) found"
+ raise Exception(
+ _("Unexpected number of VDIs (%(num_vdis)s) found"
" for VM %(vm_ref)s") % locals())
vdi_ref = vdi_refs[0]
vdi_rec = session.get_xenapi().VDI.get_record(vdi_ref)
return vdi_ref, vdi_rec
-
-
-
@classmethod
def create_snapshot(cls, session, instance_id, vm_ref, label):
""" Creates Snapshot (Template) VM, Snapshot VBD, Snapshot VDI,
- Snapshot VHD
- """
+ Snapshot VHD """
#TODO(sirp): Add quiesce and VSS locking support when Windows support
# is added
LOG.debug(_("Snapshotting VM %(vm_ref)s with label '%(label)s'...")
@@ -284,7 +281,7 @@ class VMHelper(HelperBase):
task = session.call_xenapi('Async.VM.snapshot', vm_ref, label)
template_vm_ref = session.wait_for_task(instance_id, task)
- template_vdi_rec = cls.get_vdi_for_vm_safely(session,
+ template_vdi_rec = cls.get_vdi_for_vm_safely(session,
template_vm_ref)[1]
template_vdi_uuid = template_vdi_rec["uuid"]
@@ -299,7 +296,7 @@ class VMHelper(HelperBase):
@classmethod
def get_sr(cls, session, sr_label='slices'):
- """ Finds the SR named by the given name label and returns
+ """ Finds the SR named by the given name label and returns
the UUID """
return session.call_xenapi('SR.get_by_name_label', sr_label)[0]
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index 552c2ddd1..d457f2e3f 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -345,7 +345,7 @@ class VMOps(object):
'new_base_copy_uuid': new_base_copy_uuid,
'new_cow_uuid': new_cow_uuid, }
- task = self._session.async_call_plugin('migration',
+ task = self._session.async_call_plugin('migration',
'move_vhds_into_sr', {'params': pickle.dumps(params)})
self._session.wait_for_task(instance.id, task)
@@ -469,7 +469,8 @@ class VMOps(object):
vm = VMHelper.lookup(self._session, instance.name)
return self._destroy(instance, vm, shutdown=True)
- def _destroy(self, instance, vm, shutdown=True, destroy_kernel_ramdisk=True):
+ def _destroy(self, instance, vm, shutdown=True,
+ destroy_kernel_ramdisk=True):
"""
Destroys VM instance by performing:
diff --git a/nova/virt/xenapi_conn.py b/nova/virt/xenapi_conn.py
index be018b47f..e1c5dcc7c 100644
--- a/nova/virt/xenapi_conn.py
+++ b/nova/virt/xenapi_conn.py
@@ -192,7 +192,7 @@ class XenAPIConnection(object):
def attach_disk(self, instance, disk_info):
"""Moves the copied VDIs into the SR"""
return self._vmops.attach_disk(instance, disk_info)
-
+
def suspend(self, instance, callback):
"""suspend the specified instance"""
self._vmops.suspend(instance, callback)
@@ -220,9 +220,9 @@ class XenAPIConnection(object):
def get_ajax_console(self, instance):
"""Return link to instance's ajax console"""
return self._vmops.get_ajax_console(instance)
-
+
def get_host_ip_addr(self):
- xs_url = urlparse.urlparse(FLAGS.xenapi_connection_url)
+ xs_url = urlparse.urlparse(FLAGS.xenapi_connection_url)
return xs_url.netloc
def attach_volume(self, instance_name, device_path, mountpoint):