commit 73cc85d910660e749354f0ad6c305199f68b0277 Author: Federico Ressi Date: Wed Sep 9 15:24:30 2020 +0200 Log stack trace when fails launching a defined domain Change-Id: I5165cebf8928c2214e28c61231baca7793bb421e diff --git a/nova/tests/unit/virt/libvirt/test_guest.py b/nova/tests/unit/virt/libvirt/test_guest.py index 3cab237..bbf35f0 100644 --- a/nova/tests/unit/virt/libvirt/test_guest.py +++ b/nova/tests/unit/virt/libvirt/test_guest.py @@ -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 = 'this is a test' diff --git a/nova/virt/libvirt/guest.py b/nova/virt/libvirt/guest.py index eb0ca35..c6d05ab 100644 --- a/nova/virt/libvirt/guest.py +++ b/nova/virt/libvirt/guest.py @@ -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."""