From c07b24cdd6606950b0a4fef730c277b499eb65f4 Mon Sep 17 00:00:00 2001 From: Josh Kearney Date: Tue, 20 Sep 2011 15:21:06 -0500 Subject: Fixed unit tests with some minor refactoring. --- nova/api/openstack/views/images.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/views/images.py b/nova/api/openstack/views/images.py index c41123f5e..659bfd463 100644 --- a/nova/api/openstack/views/images.py +++ b/nova/api/openstack/views/images.py @@ -18,10 +18,7 @@ import os.path from nova.api.openstack import common -from nova import flags - - -FLAGS = flags.FLAGS +from nova import utils class ViewBuilder(object): @@ -174,7 +171,7 @@ class ViewBuilderV11(ViewBuilder): def generate_alternate(self, image_id): """Create an alternate link for a specific flavor id.""" - # TODO(jk0): This will eventually need to take SSL into consideration - # when supported in glance. - return "http://%s:%d/%s/images/%s" % (FLAGS.glance_host, - FLAGS.glance_port, self.project_id, str(image_id)) + glance_url = utils.generate_glance_url() + + return "%s/%s/images/%s" % (glance_url, self.project_id, + str(image_id)) -- cgit