summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2011-11-15 17:50:32 +0000
committerGerrit Code Review <review@openstack.org>2011-11-15 17:50:32 +0000
commit4dd21a3501d975b08fc650a033d84ef5c2e5eeef (patch)
treeba7f54e6a968da23aaef7bbc40891bc38a0fa78e /nova/utils.py
parentf2fc0929d29c5722aa479911706f2294d6876b91 (diff)
parente105c53e67febefc0ae7e78baf53020d2b29c298 (diff)
downloadnova-4dd21a3501d975b08fc650a033d84ef5c2e5eeef.tar.gz
nova-4dd21a3501d975b08fc650a033d84ef5c2e5eeef.tar.xz
nova-4dd21a3501d975b08fc650a033d84ef5c2e5eeef.zip
Merge "Log the URL to an image_ref and not just the ID."
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 '',