mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-22 13:34:07 +03:00
libvirtobject: rename autostart tweaks
* Silence some pylint * set_autostart failure shouldn't reset the old name Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
b2835da3c8
commit
be05135867
@ -96,6 +96,12 @@ class vmmLibvirtObject(vmmGObject):
|
||||
def is_nodedev(self):
|
||||
return self.class_name() == "nodedev"
|
||||
|
||||
def get_autostart(self): # pragma: no cover
|
||||
pass
|
||||
def set_autostart(self, val): # pragma: no cover
|
||||
ignore = val
|
||||
pass
|
||||
|
||||
def change_name_backend(self, newbackend):
|
||||
# Used for changing the backing object after a rename
|
||||
self._backend = newbackend
|
||||
@ -118,13 +124,14 @@ class vmmLibvirtObject(vmmGObject):
|
||||
try:
|
||||
self._name = newname
|
||||
self.conn.rename_object(self, origxml, newxml)
|
||||
self.set_autostart(oldautostart)
|
||||
except Exception: # pragma: no cover
|
||||
self._name = oldname
|
||||
raise
|
||||
finally:
|
||||
self.__force_refresh_xml()
|
||||
|
||||
self.set_autostart(oldautostart)
|
||||
|
||||
|
||||
#############################################################
|
||||
# Functions that should probably be overridden in sub class #
|
||||
|
Loading…
Reference in New Issue
Block a user