Fix reconnecting to libvirt.

The right logic was in place for dealing with losing a connection to
libvirt and reconnecting.  However, it was observed that we actually get
VIR_ERR_INTERNAL_ERROR, VIR_FROM_RPC after restarting libvirtd.  The
code is just updated to deal with INTERNAL_ERROR.

Fix bug 1154473.

Change-Id: Idf4abf3fe485cf534f1732e4340fc35652fec003
This commit is contained in:
Russell Bryant
2013-03-13 11:03:42 -04:00
parent b83e3714ad
commit 1b4037e13d

View File

@@ -2864,7 +2864,8 @@ class LibvirtConnTestCase(test.TestCase):
def test_broken_connection(self):
for (error, domain) in (
(libvirt.VIR_ERR_SYSTEM_ERROR, libvirt.VIR_FROM_REMOTE),
(libvirt.VIR_ERR_SYSTEM_ERROR, libvirt.VIR_FROM_RPC)):
(libvirt.VIR_ERR_SYSTEM_ERROR, libvirt.VIR_FROM_RPC),
(libvirt.VIR_ERR_INTERNAL_ERROR, libvirt.VIR_FROM_RPC)):
conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), False)