app: drop reference to libvirt object after undefining it
Do not try to access that particular object (wrapper) when it got undefined. If anyone want to access it, appropriate code should do a new lookup, and probably re-define the object.
This commit is contained in:
parent
b5e07238a0
commit
227378f2b3
@ -484,6 +484,8 @@ class VMCollection(object):
|
||||
self.app.fire_event('domain-pre-delete', pre_event=True, vm=vm)
|
||||
try:
|
||||
vm.libvirt_domain.undefine()
|
||||
# pylint: disable=protected-access
|
||||
vm._libvirt_domain = None
|
||||
except libvirt.libvirtError as e:
|
||||
if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN:
|
||||
# already undefined
|
||||
|
Loading…
Reference in New Issue
Block a user