From be05135867fc3764dac1329ae8c04d8d314c9c11 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sat, 31 Jul 2021 19:21:09 -0400 Subject: [PATCH] libvirtobject: rename autostart tweaks * Silence some pylint * set_autostart failure shouldn't reset the old name Signed-off-by: Cole Robinson --- virtManager/object/libvirtobject.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/virtManager/object/libvirtobject.py b/virtManager/object/libvirtobject.py index 18c7df620..700389807 100644 --- a/virtManager/object/libvirtobject.py +++ b/virtManager/object/libvirtobject.py @@ -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 #