mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-08 21:18:04 +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):
|
def is_nodedev(self):
|
||||||
return self.class_name() == "nodedev"
|
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):
|
def change_name_backend(self, newbackend):
|
||||||
# Used for changing the backing object after a rename
|
# Used for changing the backing object after a rename
|
||||||
self._backend = newbackend
|
self._backend = newbackend
|
||||||
@ -118,13 +124,14 @@ class vmmLibvirtObject(vmmGObject):
|
|||||||
try:
|
try:
|
||||||
self._name = newname
|
self._name = newname
|
||||||
self.conn.rename_object(self, origxml, newxml)
|
self.conn.rename_object(self, origxml, newxml)
|
||||||
self.set_autostart(oldautostart)
|
|
||||||
except Exception: # pragma: no cover
|
except Exception: # pragma: no cover
|
||||||
self._name = oldname
|
self._name = oldname
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
self.__force_refresh_xml()
|
self.__force_refresh_xml()
|
||||||
|
|
||||||
|
self.set_autostart(oldautostart)
|
||||||
|
|
||||||
|
|
||||||
#############################################################
|
#############################################################
|
||||||
# Functions that should probably be overridden in sub class #
|
# Functions that should probably be overridden in sub class #
|
||||||
|
Loading…
Reference in New Issue
Block a user