def getIMGVersion(): ret = WebFunc.socketSend('127.0.0.1', 8888, 'get-r1s-sys-info') if ret: try: rets = ret.split(';') return {'ver': rets[0], 'upgrade': toBoolean(rets[1])} except: pass return {'ver': 'unknown', 'upgrade': False}
def _isNeedUpgrade(self): ret = WebFunc.socketSend('127.0.0.1', 8888, 'is-need-upgrade') if ret: ret = ret.split(';') res = {'uptodate':UtilFunc.toBoolean(ret[0]) == False, 'version':'', 'description':'', 'force':ret[1]} return WebFunc.jsonResult(res) else: raise cherrypy.HTTPError(462, 'Operation Failed')
def _systemUpgrade(self): ret = WebFunc.socketSend('127.0.0.1', 8888, 'upgrade-system') if not ret: raise cherrypy.HTTPError(462, 'Operation Failed') WebFunc.changeStatus()