Merge "Log stack trace when fails launching a defined domain"
This commit is contained in:
@@ -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>'
|
||||
|
@@ -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."""
|
||||
|
Reference in New Issue
Block a user