summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorJosh Kearney <josh@jk0.org>2011-11-14 15:30:14 -0600
committerJosh Kearney <josh@jk0.org>2011-11-14 15:30:23 -0600
commite105c53e67febefc0ae7e78baf53020d2b29c298 (patch)
tree9d3a6e7372010a18af23e27d142eb78043973a03 /nova/utils.py
parentd9dd8f2fd395ad02e536d8054b0615520771b93e (diff)
downloadnova-e105c53e67febefc0ae7e78baf53020d2b29c298.tar.gz
nova-e105c53e67febefc0ae7e78baf53020d2b29c298.tar.xz
nova-e105c53e67febefc0ae7e78baf53020d2b29c298.zip
Log the URL to an image_ref and not just the ID.
Change-Id: Iaae6b969d9ef3cd0f50dd3297d4b0bb51f61f5c9
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/nova/utils.py b/nova/utils.py
index ad0d5725d..7723837c9 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -337,6 +337,9 @@ def current_audit_period(unit=None):
def usage_from_instance(instance_ref, **kw):
+ image_ref_url = "%s/images/%s" % (generate_glance_url(),
+ instance_ref['image_ref'])
+
usage_info = dict(
tenant_id=instance_ref['project_id'],
user_id=instance_ref['user_id'],
@@ -347,7 +350,7 @@ def usage_from_instance(instance_ref, **kw):
created_at=str(instance_ref['created_at']),
launched_at=str(instance_ref['launched_at']) \
if instance_ref['launched_at'] else '',
- image_ref=instance_ref['image_ref'],
+ image_ref_url=image_ref_url,
state=instance_ref['vm_state'],
state_description=instance_ref['task_state'] \
if instance_ref['task_state'] else '',