summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Harris <rick.harris@rackspace.com>2011-02-16 23:39:12 +0000
committerRick Harris <rick.harris@rackspace.com>2011-02-16 23:39:12 +0000
commitc56b1814cfae7a9c814b2d37388aff5e772771b6 (patch)
tree6490ad8f26e7724b30c2558e258ffda86c19a706
parent28a38e0dc00a7a7695bfec6f33a365ac2ab2106d (diff)
downloadnova-c56b1814cfae7a9c814b2d37388aff5e772771b6.tar.gz
nova-c56b1814cfae7a9c814b2d37388aff5e772771b6.tar.xz
nova-c56b1814cfae7a9c814b2d37388aff5e772771b6.zip
Pep8 fixes
-rw-r--r--nova/tests/glance/stubs.py8
-rw-r--r--nova/virt/xenapi/vm_utils.py8
-rw-r--r--plugins/xenserver/xenapi/etc/xapi.d/plugins/glance8
3 files changed, 13 insertions, 11 deletions
diff --git a/nova/tests/glance/stubs.py b/nova/tests/glance/stubs.py
index fc120e523..c58357962 100644
--- a/nova/tests/glance/stubs.py
+++ b/nova/tests/glance/stubs.py
@@ -29,16 +29,16 @@ class FakeGlance(object):
IMAGE_FIXTURES = {
1: {'image_meta': {'name': 'fakemachine', 'size': 0,
'properties': {}},
- 'image_data': StringIO.StringIO('') },
+ 'image_data': StringIO.StringIO('')},
2: {'image_meta': {'name': 'fakekernel', 'size': 0,
'properties': {}},
- 'image_data': StringIO.StringIO('') },
+ 'image_data': StringIO.StringIO('')},
3: {'image_meta': {'name': 'fakekernel', 'size': 0,
'properties': {}},
- 'image_data': StringIO.StringIO('') },
+ 'image_data': StringIO.StringIO('')},
4: {'image_meta': {'name': 'fakekernel', 'size': 0,
'properties': {'disk_format': 'vhd'}},
- 'image_data': StringIO.StringIO('') },
+ 'image_data': StringIO.StringIO('')},
}
def __init__(self, host, port=None, use_ssl=False):
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
index d77db2ddb..33945aca3 100644
--- a/nova/virt/xenapi/vm_utils.py
+++ b/nova/virt/xenapi/vm_utils.py
@@ -289,6 +289,8 @@ class VMHelper(HelperBase):
""" Requests that the Glance plugin bundle the specified VDIs and
push them into Glance using the specified human-friendly name.
"""
+ # NOTE(sirp): Currently we only support uploading images as VHD, there
+ # is no RAW equivalent (yet)
logging.debug(_("Asking xapi to upload %(vdi_uuids)s as"
" ID %(image_id)s") % locals())
@@ -299,7 +301,7 @@ class VMHelper(HelperBase):
'sr_path': get_sr_path(session)}
kwargs = {'params': pickle.dumps(params)}
- task = session.async_call_plugin('glance', 'upload_image', kwargs)
+ task = session.async_call_plugin('glance', 'upload_vhd', kwargs)
session.wait_for_task(instance_id, task)
@classmethod
@@ -340,7 +342,7 @@ class VMHelper(HelperBase):
'sr_path': get_sr_path(session)}
kwargs = {'params': pickle.dumps(params)}
- task = session.async_call_plugin('glance', 'download_image', kwargs)
+ task = session.async_call_plugin('glance', 'download_vhd', kwargs)
vdi_uuid = session.wait_for_task(instance_id, task)
scan_sr(session, instance_id, sr_ref)
@@ -350,7 +352,7 @@ class VMHelper(HelperBase):
name_label = get_name_label_for_image(image)
session.get_xenapi().VDI.set_name_label(vdi_ref, name_label)
- LOG.debug(_("xapi 'download_image' returned VDI UUID %(vdi_uuid)s")
+ LOG.debug(_("xapi 'download_vhd' returned VDI UUID %(vdi_uuid)s")
% locals())
return vdi_uuid
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
index f737c6c41..c3f793ddd 100644
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
@@ -300,7 +300,7 @@ def _assert_process_success(proc, cmd):
return out, err
-def download_image(session, args):
+def download_vhd(session, args):
"""Download an image from Glance, unbundle it, and then deposit the VHDs
into the storage repository
"""
@@ -321,7 +321,7 @@ def download_image(session, args):
_cleanup_staging_area(staging_path)
-def upload_image(session, args):
+def upload_vhd(session, args):
"""Bundle the VHDs comprising an image and then stream them into Glance.
"""
params = pickle.loads(exists(args, 'params'))
@@ -365,7 +365,7 @@ def remove_kernel_ramdisk(session, args):
if __name__ == '__main__':
- XenAPIPlugin.dispatch({'upload_image': upload_image,
- 'download_image': download_image,
+ XenAPIPlugin.dispatch({'upload_vhd': upload_vhd,
+ 'download_vhd': download_vhd,
'copy_kernel_vdi': copy_kernel_vdi,
'remove_kernel_ramdisk': remove_kernel_ramdisk})