diff options
| author | Salvatore Orlando <salvatore.orlando@eu.citrix.com> | 2011-03-28 13:11:45 +0100 |
|---|---|---|
| committer | Salvatore Orlando <salvatore.orlando@eu.citrix.com> | 2011-03-28 13:11:45 +0100 |
| commit | 381354babab58688458b2a6cdc463eb0a0fee461 (patch) | |
| tree | 53b973c7fd199b0dc38fd9cea4e215c46e181977 /nova/virt | |
| parent | 6e0fe0d799ec5b5c2279750b8fba1bb1527ede3c (diff) | |
addressed reviewers' concerns
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/xenapi/vm_utils.py | 18 | ||||
| -rw-r--r-- | nova/virt/xenapi_conn.py | 7 |
2 files changed, 15 insertions, 10 deletions
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py index 8abd19c3c..bcf2a9962 100644 --- a/nova/virt/xenapi/vm_utils.py +++ b/nova/virt/xenapi/vm_utils.py @@ -466,17 +466,23 @@ class VMHelper(HelperBase): vdi_size += MBR_SIZE_BYTES name_label = get_name_label_for_image(image) - vdi_ref = cls.create_vdi(session, sr_ref, name_label, - vdi_size, False) + vdi_ref = cls.create_vdi(session, + sr_ref, + name_label, + vdi_size, + False) # from this point we have a VDI on Xen host # if anything goes wrong, we need to remember its uuid try: filename = None vdi_uuid = session.get_xenapi().VDI.get_uuid(vdi_ref) - with_vdi_attached_here(session, vdi_ref, False, - lambda dev: - _stream_disk(dev, image_type, - virtual_size, image_file)) + with_vdi_attached_here(session, + vdi_ref, + False, + lambda dev: _stream_disk(dev, + image_type, + virtual_size, + image_file)) if image_type in (ImageType.KERNEL, ImageType.RAMDISK): # we need to invoke a plugin for copying VDI's # content into proper path diff --git a/nova/virt/xenapi_conn.py b/nova/virt/xenapi_conn.py index c7e94c508..191498916 100644 --- a/nova/virt/xenapi_conn.py +++ b/nova/virt/xenapi_conn.py @@ -367,10 +367,9 @@ class XenAPISession(object): try: name = self._session.xenapi.task.get_name_label(task) status = self._session.xenapi.task.get_status(task) - action = dict( - action=name[0:255], # Ensure action is never > 255 - instance_id=id and int(id) or None, - error=None) + action = dict(action=name[0:255], + instance_id=id and int(id) or None, + error=None) if status == "pending": return elif status == "success": |
