summaryrefslogtreecommitdiffstats
path: root/nova/virt
diff options
context:
space:
mode:
authorRick Harris <rick.harris@rackspace.com>2011-06-09 21:36:20 +0000
committerRick Harris <rick.harris@rackspace.com>2011-06-09 21:36:20 +0000
commite307bf5dd60dc84587f76d88956499ee1f1013fb (patch)
tree5fed05d4909c947e6fb3650a1042f6639f46171c /nova/virt
parentbe9b25b225d2b4c25e1b977e1e4b8166b3dacaf4 (diff)
downloadnova-e307bf5dd60dc84587f76d88956499ee1f1013fb.tar.gz
nova-e307bf5dd60dc84587f76d88956499ee1f1013fb.tar.xz
nova-e307bf5dd60dc84587f76d88956499ee1f1013fb.zip
Fixing code per review comments
Diffstat (limited to 'nova/virt')
-rw-r--r--nova/virt/images.py12
-rw-r--r--nova/virt/xenapi/vm_utils.py3
2 files changed, 2 insertions, 13 deletions
diff --git a/nova/virt/images.py b/nova/virt/images.py
index e6f3d3c9e..40bf6107c 100644
--- a/nova/virt/images.py
+++ b/nova/virt/images.py
@@ -43,15 +43,3 @@ def fetch(image_href, path, _user, _project):
elevated = context.get_admin_context()
metadata = image_service.get(elevated, image_id, image_file)
return metadata
-
-
-# TODO(vish): xenapi should use the glance client code directly instead
-# of retrieving the image using this method.
-def image_url(image):
- if FLAGS.image_service == "nova.image.glance.GlanceImageService":
- glance_host, glance_port = \
- glance_image_service.pick_glance_api_server()
- return "http://%s:%s/images/%s" % (glance_host, glance_port, image)
-
- return "http://%s:%s/_images/%s/image" % (FLAGS.s3_host, FLAGS.s3_port,
- image)
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
index ccde6cbfe..b9d4346e4 100644
--- a/nova/virt/xenapi/vm_utils.py
+++ b/nova/virt/xenapi/vm_utils.py
@@ -581,7 +581,8 @@ class VMHelper(HelperBase):
Returns: A single filename if image_type is KERNEL_RAMDISK
A list of dictionaries that describe VDIs, otherwise
"""
- url = images.image_url(image)
+ url = "http://%s:%s/_images/%s/image" % (FLAGS.s3_host, FLAGS.s3_port,
+ image)
LOG.debug(_("Asking xapi to fetch %(url)s as %(access)s") % locals())
if image_type == ImageType.KERNEL_RAMDISK:
fn = 'get_kernel'