Ensuring libvirt is restarted before cleanout.
This commit is contained in:
parent
d4fcdd0282
commit
1e52286079
@ -204,7 +204,7 @@ class NovaUninstaller(comp.PythonUninstallComponent):
|
|||||||
if virt_driver == virsh.VIRT_TYPE:
|
if virt_driver == virsh.VIRT_TYPE:
|
||||||
inst_prefix = self.cfg.get('nova', 'instance_name_prefix')
|
inst_prefix = self.cfg.get('nova', 'instance_name_prefix')
|
||||||
libvirt_type = virsh.default(self.cfg.get('nova', 'libvirt_type'))
|
libvirt_type = virsh.default(self.cfg.get('nova', 'libvirt_type'))
|
||||||
virsh.clear_libvirt_domains(libvirt_type, inst_prefix)
|
virsh.clear_libvirt_domains(self.distro, libvirt_type, inst_prefix)
|
||||||
|
|
||||||
|
|
||||||
class NovaInstaller(comp.PythonInstallComponent):
|
class NovaInstaller(comp.PythonInstallComponent):
|
||||||
|
@ -143,7 +143,7 @@ def virt_ok(virt_type, distro):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def clear_libvirt_domains(virt_type, inst_prefix):
|
def clear_libvirt_domains(distro, virt_type, inst_prefix):
|
||||||
libvirt = _get_virt_lib()
|
libvirt = _get_virt_lib()
|
||||||
if not libvirt:
|
if not libvirt:
|
||||||
LOG.warn("Could not clear out libvirt domains, libvirt not available for python.")
|
LOG.warn("Could not clear out libvirt domains, libvirt not available for python.")
|
||||||
@ -154,6 +154,7 @@ def clear_libvirt_domains(virt_type, inst_prefix):
|
|||||||
return
|
return
|
||||||
with sh.Rooted(True):
|
with sh.Rooted(True):
|
||||||
LOG.info("Attempting to clear out leftover libvirt domains using protocol %s" % (virt_protocol))
|
LOG.info("Attempting to clear out leftover libvirt domains using protocol %s" % (virt_protocol))
|
||||||
|
restart(distro)
|
||||||
conn = None
|
conn = None
|
||||||
try:
|
try:
|
||||||
conn = libvirt.open(virt_protocol)
|
conn = libvirt.open(virt_protocol)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user