diff options
| author | Dan Prince <dprince@redhat.com> | 2012-08-28 10:09:05 -0400 |
|---|---|---|
| committer | Dan Prince <dprince@redhat.com> | 2012-08-28 10:09:05 -0400 |
| commit | f3c594a9b862b583f8edbe6027f43d9b8c8ce82a (patch) | |
| tree | 81bd6bae96dd01b100489eab3861a6799f5f5c19 | |
| parent | 458ee2eac0dbcfb1596cd6cf43b7a341e78f8f82 (diff) | |
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
| -rw-r--r-- | nova/tests/integrated/test_api_samples.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/tests/integrated/test_api_samples.py b/nova/tests/integrated/test_api_samples.py index 0c454cb60..4d67ea51d 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] |
