summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nova/api/openstack/servers.py4
-rw-r--r--nova/compute/api.py8
-rw-r--r--nova/compute/manager.py2
-rw-r--r--nova/tests/xenapi/stubs.py2
-rw-r--r--nova/virt/xenapi/vm_utils.py16
-rw-r--r--nova/virt/xenapi/vmops.py11
6 files changed, 22 insertions, 21 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index ceb17c9e4..c2bf42b72 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -203,8 +203,8 @@ class Controller(wsgi.Controller):
return exc.HTTPNoContent()
def action(self, req, id):
- """ Multi-purpose method used to reboot, rebuild, or
- resize a server """
+ """Multi-purpose method used to reboot, rebuild, or
+ resize a server"""
actions = {
'reboot': self._action_reboot,
diff --git a/nova/compute/api.py b/nova/compute/api.py
index bfa5c7dba..ce9da727d 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -430,8 +430,8 @@ class API(base.Base):
migration_ref = self.db.migration_get_by_instance_and_status(context,
instance_id, 'finished')
if not migration_ref:
- raise exception.NotFound(_("No finished migrations found for \
- instance"))
+ raise exception.NotFound(_("No finished migrations found for "
+ "instance"))
params = {'migration_id': migration_ref['id']}
self._cast_compute_message('revert_resize', context, instance_id,
@@ -444,8 +444,8 @@ class API(base.Base):
migration_ref = self.db.migration_get_by_instance_and_status(context,
instance_id, 'finished')
if not migration_ref:
- raise exception.NotFound(_("No finished migrations found for \
- instance"))
+ raise exception.NotFound(_("No finished migrations found for "
+ "instance"))
instance_ref = self.db.instance_get(context, instance_id)
params = {'migration_id': migration_ref['id']}
self._cast_compute_message('confirm_resize', context, instance_id,
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 1c42b383c..b3e864154 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -414,7 +414,7 @@ class ComputeManager(manager.Manager):
@exception.wrap_exception
@checks_instance_lock
def confirm_resize(self, context, instance_id, migration_id):
- """ Destroys the source instance """
+ """Destroys the source instance"""
context = context.elevated()
instance_ref = self.db.instance_get(context, instance_id)
migration_ref = self.db.migration_get(context, migration_id)
diff --git a/nova/tests/xenapi/stubs.py b/nova/tests/xenapi/stubs.py
index d17951b81..caefcff34 100644
--- a/nova/tests/xenapi/stubs.py
+++ b/nova/tests/xenapi/stubs.py
@@ -221,7 +221,7 @@ class FakeSessionForVolumeFailedTests(FakeSessionForVolumeTests):
class FakeSessionForMigrationTests(fake.SessionBase):
- """ Stubs out a XenAPISession for Migration tests """
+ """Stubs out a XenAPISession for Migration tests"""
def __init__(self, uri):
super(FakeSessionForMigrationTests, self).__init__(uri)
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
index ca2d634f1..eff207a51 100644
--- a/nova/virt/xenapi/vm_utils.py
+++ b/nova/virt/xenapi/vm_utils.py
@@ -270,8 +270,8 @@ class VMHelper(HelperBase):
@classmethod
def create_snapshot(cls, session, instance_id, vm_ref, label):
- """ Creates Snapshot (Template) VM, Snapshot VBD, Snapshot VDI,
- Snapshot VHD """
+ """Creates Snapshot (Template) VM, Snapshot VBD, Snapshot VDI,
+ 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 +284,7 @@ class VMHelper(HelperBase):
original_parent_uuid = get_vhd_parent_uuid(session, vm_vdi_ref)
task = session.call_xenapi('Async.VM.snapshot', vm_ref, label)
- template_vm_ref = session.wait_for_task(instance_id, task)
+ template_vm_ref = session.wait_for_task(task, instance_id)
template_vdi_rec = cls.get_vdi_for_vm_safely(session,
template_vm_ref)[1]
template_vdi_uuid = template_vdi_rec["uuid"]
@@ -302,14 +302,14 @@ class VMHelper(HelperBase):
@classmethod
def get_sr(cls, session, sr_label='slices'):
- """ Finds the SR named by the given name label and returns
- the UUID """
+ """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]
@classmethod
def get_sr_path(cls, session, sr_label='slices'):
- """ Finds the SR and then coerces it into a path on the dom0 file
- system """
+ """Finds the SR and then coerces it into a path on the dom0 file
+ system"""
return FLAGS.xenapi_sr_base_path + cls.get_sr(session, sr_label)
@classmethod
@@ -643,7 +643,7 @@ class VMHelper(HelperBase):
if sr_ref:
LOG.debug(_("Re-scanning SR %s"), sr_ref)
task = session.call_xenapi('Async.SR.scan', sr_ref)
- session.wait_for_task(instance_id, task)
+ session.wait_for_task(task, instance_id)
@classmethod
def scan_default_sr(cls, session):
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index 60ce51f4a..01bfa2dc5 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -233,7 +233,7 @@ class VMOps(object):
"start")
def snapshot(self, instance, image_id):
- """ Create snapshot from a running VM instance
+ """Create snapshot from a running VM instance
:param instance: instance to be snapshotted
:param image_id: id of image to upload to
@@ -285,7 +285,7 @@ class VMOps(object):
return
def migrate_disk_and_power_off(self, instance, dest):
- """ Copies a VHD from one host machine to another
+ """Copies a VHD from one host machine to another
:param instance: the instance that owns the VHD in question
:param dest: the destination host machine
@@ -314,7 +314,7 @@ class VMOps(object):
task = self._session.async_call_plugin('migration', 'transfer_vhd',
{'params': pickle.dumps(params)})
- self._session.wait_for_task(instance.id, task)
+ self._session.wait_for_task(task, instance.id)
# Now power down the instance and transfer the COW VHD
self._shutdown(instance, vm_ref, method='clean')
@@ -326,7 +326,7 @@ class VMOps(object):
task = self._session.async_call_plugin('migration', 'transfer_vhd',
{'params': pickle.dumps(params)})
- self._session.wait_for_task(instance.id, task)
+ self._session.wait_for_task(task, instance.id)
finally:
if template_vm_ref:
@@ -338,6 +338,7 @@ class VMOps(object):
return {'base_copy': base_copy_uuid, 'cow': cow_uuid}
def attach_disk(self, instance, disk_info):
+ """Links the base copy VHD to the COW via the XAPI plugin"""
vm_ref = VMHelper.lookup(self._session, instance.name)
new_base_copy_uuid = str(uuid.uuid4())
new_cow_uuid = str(uuid.uuid4())
@@ -350,7 +351,7 @@ class VMOps(object):
task = self._session.async_call_plugin('migration',
'move_vhds_into_sr', {'params': pickle.dumps(params)})
- self._session.wait_for_task(instance.id, task)
+ self._session.wait_for_task(task, instance.id)
# Now we rescan the SR so we find the VHDs
VMHelper.scan_default_sr(self._session)