Explorar o código

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.
Marek Marczykowski-Górecki %!s(int64=6) %!d(string=hai) anos
pai
achega
227378f2b3
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      qubes/app.py

+ 2 - 0
qubes/app.py

@@ -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