From f3c594a9b862b583f8edbe6027f43d9b8c8ce82a Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Tue, 28 Aug 2012 10:09:05 -0400 Subject: [PATCH] Fix KeyError when test_servers_get fails. Updates the integrated.test_api_samples.ServersSampleAllExtensionXmlTest test_servers_get function so that it doesn't try to list the line number when the test fails. Fixes a KeyError: '\'i\' exceptions. Partial fix for LP Bug #1042709. Change-Id: I666d18c1d4585cebce4534b1f16cd327850e8cdc --- nova/tests/integrated/test_api_samples.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/tests/integrated/test_api_samples.py b/nova/tests/integrated/test_api_samples.py index 0c454cb60b57..4d67ea51dd64 100644 --- a/nova/tests/integrated/test_api_samples.py +++ b/nova/tests/integrated/test_api_samples.py @@ -100,10 +100,10 @@ class ApiSampleTestBase(integrated_helpers._IntegratedTestBase): try: match = re.match(line, result_line) except Exception as exc: - self.fail(_('Response error on line %(i)s:\n' + self.fail(_('Response error on line:\n' '%(line)s\n%(result_line)s') % locals()) if not match: - self.fail(_('Response error on line %(i)s:\n' + self.fail(_('Response error on line:\n' '%(line)s\n%(result_line)s') % locals()) if match.groups(): result = match.groups()[0]