Merge branch 'backend_dev' of gitlab2.kylin.com:kylin-desktop/update-manager-group/kylin-system-updater into backend_dev
This commit is contained in:
commit
dd1d498a4c
|
@ -110,11 +110,25 @@ class UpdateManager():
|
|||
|
||||
#进行更新的操作
|
||||
def start_update(self):
|
||||
try:
|
||||
_success = True
|
||||
header = ''
|
||||
desc = ''
|
||||
|
||||
#FIXME: 进行两次更新,在更新cache之前获取source.list 更新完成之后再进行一次 为了区别服务器错误和网络错误
|
||||
try:
|
||||
#进行检查网络
|
||||
self.dbusController.UpdateDetectStatusChanged(5,_("Checking network connection"))
|
||||
_success,header,desc = self.dbusController.check_connectivity()
|
||||
if _success == False:
|
||||
self.dbusController.UpdateDetectFinished(_success,[],header,desc)
|
||||
return
|
||||
|
||||
#从服务器端更新摸板
|
||||
self.dbusController.UpdateDetectStatusChanged(10,_("Updating Source Template"))
|
||||
if self.options.no_update_source is False:
|
||||
self.dbusController._on_update_important_list()
|
||||
_success,header,desc = self.dbusController._on_update_important_list()
|
||||
if _success == False:
|
||||
self.dbusController.UpdateDetectFinished(_success,[],header,desc)
|
||||
return
|
||||
|
||||
update_backend = get_backend(self, InstallBackend.ACTION_UPDATE)
|
||||
update_backend.start()
|
||||
|
@ -272,12 +286,6 @@ class UpdateManager():
|
|||
logging.warning("start fix Abnormal Reboot broken pkgs...")
|
||||
self.start_fix_broken()
|
||||
return False,header,desc
|
||||
|
||||
#更新important.list
|
||||
if self.options.no_update_source is False:
|
||||
_success,header,desc = self.dbusController._on_update_important_list()
|
||||
if _success == False:
|
||||
return _success,header,desc
|
||||
|
||||
self.update_list = UpdateList(self)
|
||||
|
||||
|
|
|
@ -63,11 +63,11 @@ class UpdateManagerDbusController(dbus.service.Object):
|
|||
lock = threading.Lock()
|
||||
bus = dbus.SystemBus()
|
||||
try:
|
||||
logging.info("start to update Source Template...")
|
||||
logging.info("Start to update Source Template...")
|
||||
obj = bus.get_object('com.kylin.software.properties', '/com/kylin/software/properties')
|
||||
interface = dbus.Interface(obj, dbus_interface='com.kylin.software.properties.interface')
|
||||
lock.acquire()
|
||||
retval = interface.updateSourceTemplate()
|
||||
retval = interface.updateSourceTemplate(timeout=5)
|
||||
lock.release()
|
||||
except Exception as e:
|
||||
header = _("update important list occur Exception")
|
||||
|
@ -81,7 +81,7 @@ class UpdateManagerDbusController(dbus.service.Object):
|
|||
logging.warning(header + desc)
|
||||
return retval,header,desc
|
||||
else:
|
||||
logging.info("update sourceTemplate successed...")
|
||||
logging.info("Update sourceTemplate successed...")
|
||||
return retval,header,desc
|
||||
|
||||
#重启aptdeamon后台服务
|
||||
|
@ -100,6 +100,29 @@ class UpdateManagerDbusController(dbus.service.Object):
|
|||
logging.error(header + desc)
|
||||
return False,header,desc
|
||||
|
||||
def check_connectivity(self):
|
||||
header = ''
|
||||
desc = ''
|
||||
|
||||
bus = dbus.SystemBus()
|
||||
try:
|
||||
logging.info("Start to check network connectivity...")
|
||||
obj = bus.get_object("org.freedesktop.NetworkManager","/org/freedesktop/NetworkManager")
|
||||
interface = dbus.Interface(obj, "org.freedesktop.NetworkManager")
|
||||
retval = interface.CheckConnectivity(timeout=5)
|
||||
logging.info("Check network connectivity to Complete...")
|
||||
if retval == 4:
|
||||
return True,header,desc
|
||||
else:
|
||||
header = _("Please check your network connection and retry.")
|
||||
return False,header,desc
|
||||
|
||||
except Exception as e:
|
||||
header = _("Please check your network connection and retry.")
|
||||
logging.error(str(e))
|
||||
logging.error(header + desc)
|
||||
return False,header,desc
|
||||
|
||||
#检测网络的状态
|
||||
# def _on_network_alert(self, watcher, state):
|
||||
# if state in NetworkManagerHelper.NM_STATE_CONNECTED_LIST:
|
||||
|
|
|
@ -2554,13 +2554,13 @@ msgid "%.0f kB"
|
|||
msgstr "%.0f kB"
|
||||
|
||||
msgid "Failed to get update software push, please try to update again later"
|
||||
msgstr "获取软件推送失败,请稍后再进行尝试更新"
|
||||
msgstr "无法访问源管理服务器,请稍后再试"
|
||||
|
||||
msgid "Connection exception with push server"
|
||||
msgstr "推送服务器连接异常"
|
||||
|
||||
msgid "update important list occur Exception"
|
||||
msgstr "获取推送出现异常"
|
||||
msgstr "获取推送出现异常,稍后再试"
|
||||
|
||||
msgid "You need to be root to run this application"
|
||||
msgstr "你需要root权限运行"
|
||||
|
@ -2572,13 +2572,22 @@ msgid "Check if the upgrade package does not exist for this upgrade"
|
|||
msgstr "检查升级包是否不存在本次升级"
|
||||
|
||||
msgid "read important list failed"
|
||||
msgstr "读取推送升级列表失败"
|
||||
msgstr "无法读取推送升级列表,请稍后再试"
|
||||
|
||||
msgid "groups JSON ConfigPkgs install failed"
|
||||
msgstr "分组配置包安装失败"
|
||||
msgstr "无法安装分组配置文件,请稍后再试"
|
||||
|
||||
msgid "Installtion timeout to exit Due to inactivity"
|
||||
msgstr "安装超时退出由于"
|
||||
|
||||
msgid "Disk space is insufficient, please clean the disk and then upgrade"
|
||||
msgstr "磁盘空间不足,请清理磁盘后进行升级更新"
|
||||
|
||||
msgid "Please check your network connection and retry."
|
||||
msgstr "请检查您的网络连接后再试。"
|
||||
|
||||
msgid "Checking network connection"
|
||||
msgstr "检查网络连接中"
|
||||
|
||||
msgid "Updating Source Template"
|
||||
msgstr "更新源摸板中"
|
Loading…
Reference in New Issue