From cd392de955e442d93cfca6efab8a51d64e7f9940 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Mon, 19 Sep 2011 18:13:08 -0400 Subject: use dictionary format for exception message --- nova/virt/images.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nova/virt/images.py b/nova/virt/images.py index 3aee83e2d..3ea579c7a 100644 --- a/nova/virt/images.py +++ b/nova/virt/images.py @@ -76,9 +76,10 @@ def fetch_to_raw(context, image_href, path, _user_id, _project_id): if fmt != "raw": staged = "%s.converted" % path if "backing file" in data: + backing_file = data['backing file'] raise exception.ImageUnacceptable(image_id=image_href, - reason=_("Dangerous! fmt=%s with backing file: %s") % - (fmt, data['backing file'])) + reason=_("Dangerous! fmt=%(fmt) backed by: %(backing_file)") % + locals) LOG.debug("%s was %s, converting to raw" % (image_href, fmt)) out, err = utils.execute('qemu-img', 'convert', '-O', 'raw', -- cgit