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
This commit is contained in:
Ken'ichi Ohmichi
2013-08-27 20:03:51 +09:00
parent 1b0165b808
commit 3277bf3d7b
2 changed files with 2 additions and 2 deletions
@@ -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:
@@ -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: