mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-12 09:18:00 +03:00
libvirtobject: Invalidate cache if redefine fails
This commit is contained in:
parent
771154d104
commit
1c63c2b0d9
@ -203,7 +203,14 @@ class vmmLibvirtObject(vmmGObject):
|
||||
if not self._xmlobj_to_define:
|
||||
logging.debug("No cached XML to define, skipping.")
|
||||
return
|
||||
self._redefine_object(self._xmlobj_to_define)
|
||||
|
||||
try:
|
||||
self._redefine_object(self._xmlobj_to_define)
|
||||
except:
|
||||
# If something fails here, we need to drop the cached object,
|
||||
# since some edits like addhardware.py may not be idempotent
|
||||
self._invalidate_xml()
|
||||
raise
|
||||
|
||||
|
||||
#########################
|
||||
|
Loading…
Reference in New Issue
Block a user