Merge "Log stack trace when fails launching a defined domain"

This commit is contained in:
Zuul authored and Gerrit Code Review committed 2020-10-06 00:30:48 +00:00
commit 07c68e45dd
2 files changed
+3 -4

No files matched your search

+1 -1
View File
@@ -80,7 +80,7 @@ class GuestTestCase(test.NoDBTestCase):
self.domain.createWithFlags.assert_called_once_with(
fakelibvirt.VIR_DOMAIN_START_PAUSED)
@mock.patch.object(libvirt_guest.LOG, 'error')
@mock.patch.object(libvirt_guest.LOG, 'exception')
@mock.patch.object(encodeutils, 'safe_decode')
def test_launch_exception(self, mock_safe_decode, mock_log):
fake_xml = '<test>this is a test</test>'
+2 -3
View File
@@ -155,9 +155,8 @@ class Guest(object):
return self._domain.createWithFlags(flags)
except Exception:
with excutils.save_and_reraise_exception():
LOG.error('Error launching a defined domain '
'with XML: %s',
self._encoded_xml, errors='ignore')
LOG.exception('Error launching a defined domain with XML: %s',
self._encoded_xml, errors='ignore')
def poweroff(self):
"""Stops a running guest."""