调整部分逻辑

This commit is contained in:
wangsong 2021-11-24 14:09:08 +08:00
parent dd18785a13
commit a434a37b00
1 changed files with 3 additions and 4 deletions

View File

@ -77,8 +77,8 @@ class UpdateManagerDbusController(dbus.service.Object):
#重启aptdeamon后台服务 #重启aptdeamon后台服务
def make_aptdeamon_restart(self): def make_aptdeamon_restart(self):
header = None header = ''
desc = None desc = ''
try: try:
obj = self.bus.get_object('org.debian.apt', '/org/debian/apt') obj = self.bus.get_object('org.debian.apt', '/org/debian/apt')
@ -86,8 +86,7 @@ class UpdateManagerDbusController(dbus.service.Object):
retval = interface.Quit() retval = interface.Quit()
except Exception as e: except Exception as e:
header = _("aptdeamon restart occur Exception") header = _("aptdeamon restart occur Exception")
desc = str(e) logging.error(str(e))
logging.error(header + desc)
return False,header,desc return False,header,desc
def check_connectivity(self): def check_connectivity(self):