From 3277bf3d7bfc3faa4ff3f96e6c77ee4eacfa9f45 Mon Sep 17 00:00:00 2001 From: Ken'ichi Ohmichi Date: Tue, 27 Aug 2013 20:03:51 +0900 Subject: [PATCH] Fix the message of coverage directory error If a coverage-report directory conflicts, the error message is incomplete like the following: $ nova coverage-start --combine Coverage collection started $ $ nova coverage-report --html test01 Report path: /tmp/nova-coverage_Krl__k/test01 $ $ nova coverage-start --combine Coverage collection started $ nova coverage-report --html test01 ERROR: Directory conflict: %s already exists (HTTP 400) $ This patch fixes the message. Fixes bug #1217315 Change-Id: Ie21b0e87262a3caef36d93711ee96529ec699cec --- nova/api/openstack/compute/contrib/coverage_ext.py | 2 +- nova/api/openstack/compute/plugins/v3/coverage.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/api/openstack/compute/contrib/coverage_ext.py b/nova/api/openstack/compute/contrib/coverage_ext.py index d77dff6c8e..a69ef93673 100644 --- a/nova/api/openstack/compute/contrib/coverage_ext.py +++ b/nova/api/openstack/compute/contrib/coverage_ext.py @@ -215,7 +215,7 @@ class CoverageController(object): coverInst.xml_report(outfile=path) elif html: if os.path.isdir(path): - msg = _("Directory conflict: %s already exists") + msg = _("Directory conflict: %s already exists") % path raise exc.HTTPBadRequest(explanation=msg) coverInst.html_report(directory=path) else: diff --git a/nova/api/openstack/compute/plugins/v3/coverage.py b/nova/api/openstack/compute/plugins/v3/coverage.py index 90c02b6f27..43763ffab9 100644 --- a/nova/api/openstack/compute/plugins/v3/coverage.py +++ b/nova/api/openstack/compute/plugins/v3/coverage.py @@ -248,7 +248,7 @@ class CoverageController(wsgi.Controller): coverInst.xml_report(outfile=path) elif html: if os.path.isdir(path): - msg = _("Directory conflict: %s already exists") + msg = _("Directory conflict: %s already exists") % path raise exc.HTTPBadRequest(explanation=msg) coverInst.html_report(directory=path) else: