summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorChris Behrens <cbehrens@codestud.com>2012-05-09 19:20:46 +0000
committerChris Behrens <cbehrens@codestud.com>2012-05-09 19:22:39 +0000
commit55e6021ce36b2f2d4ef9222252b9ab784f67d9f7 (patch)
tree32e60a9e41d8dc8bdf59a2d5cae81dfb5c153bd7 /nova/utils.py
parent36a810e5456e4ef1c328d433c24a68a1c1ce886d (diff)
Defer image_ref update to manager on rebuild
We shouldn't update the DB and use it for passing the new image_ref for a rebuild. This causes a usage exists notification for the new image instead of the old... and technically the new image is not accurate until we shutdown the old instance and try building the new one.. Fixes bug 997245 Change-Id: Ia4bd4b8af90080a11875d9ee56661286bc3f5593
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/nova/utils.py b/nova/utils.py
index 0c20dd34d..69011fb61 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -1259,6 +1259,11 @@ def generate_glance_url():
return "http://%s:%d" % (FLAGS.glance_host, FLAGS.glance_port)
+def generate_image_url(image_ref):
+ """Generate a image URL from an image_ref."""
+ return "%s/images/%s" % (generate_glance_url(), image_ref)
+
+
@contextlib.contextmanager
def logging_error(message):
"""Catches exception, write message to the log, re-raise.