Prechádzať zdrojové kódy

update get update list

TooY 2 rokov pred
rodič
commit
49bbec2c8f

+ 4 - 13
appmanage/api/service/manage.py

@@ -40,8 +40,10 @@ def get_github_content(repo, path):
     return contents
 
 
-# 获取指定仓库CHANGELOG
-def get_update_list(local_path, repo):
+# 获取 update info
+def get_update_list():
+    local_path = '/data/apps/stackhub/install/version.json'
+    repo = 'StackHub'
     op = shell_execute.execute_command_output_all("cat " + local_path)['result']
     local_version = json.loads(op)['VERSION']
     version_contents = get_github_content(repo, 'install/version.json')
@@ -63,17 +65,6 @@ def get_update_list(local_path, repo):
         return None
 
 
-# 获取所有CHANGELOG
-def get_all_update_list():
-    stack_hub_change = get_update_list('/data/apps/stackhub/install/version.json', 'StackHub')
-    if stack_hub_change != None:
-        ret = []
-        ret.append(stack_hub_change)
-        return ret
-    else:
-        return None
-
-
 def conbine_list(installing_list, installed_list):
     app_list = installing_list + installed_list
     result_list = []

+ 1 - 1
appmanage/api/v1/routers/apps.py

@@ -351,7 +351,7 @@ def AppUpdateList(request: Request):
         get_headers(request)
         ret = {}
         ret['ResponseData'] = {}
-        ret['ResponseData']['Update_content'] = manage.get_all_update_list()
+        ret['ResponseData']['Update_content'] = manage.get_update_list()
         myLogger.info_logger(ret)
         response = JSONResponse(content=ret)
     except CommandException as ce: