summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/views/images.py13
1 files changed, 5 insertions, 8 deletions
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))