Exception traces in the test output

Console type "FAKE" not supported.

A unit test calls get_console() with a "FAKE" console type. The get_console()
call is logging both the key error and exception generated. Looking at the
get_console code, it doesn't seem necessary to log these exceptions at such a
high level at this point in the code.

Change-Id: Ibb96a4a483b71b5d4b8542b38f4e261ad50ea6d3
Closes-Bug: #1322262
This commit is contained in:
David Lapsley 2014-05-22 11:12:05 -07:00
parent 566c4a0b10
commit 5955f52c6b
2 changed files with 3 additions and 4 deletions

View File

@ -39,7 +39,6 @@ def get_console(request, console_type, instance):
check_consoles = {'console_type': CONSOLES[console_type]}
except KeyError:
msg = _('Console type "%s" not supported.') % console_type
LOG.error(msg)
raise exceptions.NotAvailable(msg)
for api_call in check_consoles.values():
@ -49,8 +48,8 @@ def get_console(request, console_type, instance):
#in case of AUTO
except nova_exception.HTTPNotImplemented:
continue
except Exception as e:
LOG.exception(e)
except Exception:
LOG.debug('Console not available', exc_info=True)
continue
console_url = "%s&%s(%s)" % (

View File

@ -64,7 +64,7 @@ class ConsoleTab(tabs.Tab):
try:
console_url = console.get_console(request, console_type, instance)
except exceptions.NotAvailable:
pass
exceptions.handle(request, ignore=True, force_log=True)
return {'console_url': console_url, 'instance_id': instance.id}