Commit 49aaf8d2 authored by 金凯强's avatar 金凯强 🎨

没有app信息不报错了返回空数组

parent 22924ed6
...@@ -5,74 +5,74 @@ import requests ...@@ -5,74 +5,74 @@ import requests
if __name__ == '__main__': if __name__ == '__main__':
data = {'user_name': 'jkq', 'password': 'jkq_test'} data = {'user_name': 'jkq', 'password': 'jkq_test'}
# # 设置登录信息 # 设置登录信息
# requests.post('http://localhost:5000/authorization/',json=data) requests.post('http://localhost:5000/authorization/',json=data)
# # 登录 # 登录
# res = requests.post('http://localhost:5000/authorization/login/',json=data) res = requests.post('http://localhost:5000/authorization/login/',json=data)
# print(res.json()) print(res.json())
# # 获取项目链接 # 获取项目链接
# res = requests.get('http://localhost:5000/connection/') res = requests.get('http://localhost:5000/connection/')
# print(res.json()) print(res.json())
# json_data = {"project_no": "jkq_test", "db_ip": "47.97.206.38", "db_port": "9610", "db_user": "huansi", json_data = {"project_no": "jkq_test", "db_ip": "47.97.206.38", "db_port": "9610", "db_user": "huansi",
# "db_password": "huansi", "mes_db_name": "HSGmtMes", "tiip_db_name": "HSTIIP", "db_password": "huansi", "mes_db_name": "HSGmtMes", "tiip_db_name": "HSTIIP",
# "host_ip": "192.168.4.116","id":"1237937496479928320"} "host_ip": "192.168.4.116","id":"1237937496479928320"}
#
# # 设置项目链接 # 设置项目链接
# res = requests.post('http://localhost:5000/connection/', json=json_data) res = requests.post('http://localhost:5000/connection/', json=json_data)
# print(res.json()) print(res.json())
# # 测试项目数据库连接 # 测试项目数据库连接
# res = requests.get('http://localhost:5000/connection/jkq_test/HSGmtMEs/') res = requests.get('http://localhost:5000/connection/jkq_test/HSGmtMEs/')
# print(res.json()) print(res.json())
# json_data = {"project_no": "jkq_test", "server_ip": "jkqjkq.top", "server_ssh_port": "22", json_data = {"project_no": "jkq_test", "server_ip": "192.168.4.116", "server_ssh_port": "1111",
# "server_user": "root", "server_user": "root",
# "server_password": "Jin1Kai2"} "server_password": "huansi.net","id":1237968030966910976}
#
# # 设置远程服务器连接 # 设置远程服务器连接
# res = requests.post('http://localhost:5000/connection/remote_server/', json=json_data) res = requests.post('http://localhost:5000/connection/remote_server/', json=json_data)
# print(res.json()) print(res.json())
# # 获取远程服务器连接 # 获取远程服务器连接
# res = requests.get('http://localhost:5000/connection/remote_server/') res = requests.get('http://localhost:5000/connection/remote_server/')
# print(res.json()) print(res.json())
# # 测试端口是否开放 # 测试端口是否开放
# res = requests.get('http://localhost:5000/connection/test_port/23002/') res = requests.get('http://localhost:5000/connection/test_port/23002/')
# print(res.json()) print(res.json())
# # 获取app_list # 获取app_list
# res = requests.get('http://localhost:5000/info/app_list/') res = requests.get('http://localhost:5000/info/app_list/')
# print(json.dumps(res.json(), indent=4)) print(json.dumps(res.json(), indent=4))
# # 配置app升级信息 # 配置app升级信息
# json_data = [ json_data = [
# {"app_code": "rabbitMQ", "app_name": "rabbitMQ", "app_image": "47.110.145.204:8084/huansi/mq:latest"}, {"app_code": "rabbitMQ", "app_name": "rabbitMQ", "app_image": "47.110.145.204:8084/huansi/mq:latest"},
# {"app_code": "Redis", "app_name": "Redis", "app_image": "47.110.145.204:8084/huansi/redis:latest"}, {"app_code": "Redis", "app_name": "Redis", "app_image": "47.110.145.204:8084/huansi/redis:latest"},
# {"app_code": "Tool", "app_name": "tools工具集", "app_image": "47.110.145.204:8084/huansi/hs_tools:1.1"}] {"app_code": "Tool", "app_name": "tools工具集", "app_image": "47.110.145.204:8084/huansi/hs_tools:1.1"}]
#
# res = requests.post('http://localhost:5000/info/app_upgrade/', json=json_data) res = requests.post('http://localhost:5000/info/app_upgrade/', json=json_data)
# print(res.json()) print(res.json())
# # 获取app升级日志列表 # 获取app升级日志列表
# res = requests.get('http://localhost:5000/info/upgrade_log/') res = requests.get('http://localhost:5000/info/upgrade_log/')
# print(json.dumps(res.json(), indent=4)) print(json.dumps(res.json(), indent=4))
#
#
# # 获取app单次升级日志明细 # 获取app单次升级日志明细
# res = requests.get('http://localhost:5000/info/upgrade_log_dtl/1237995081698545664/') res = requests.get('http://localhost:5000/info/upgrade_log_dtl/1237995081698545664/')
# print(json.dumps(res.json(), indent=4)) print(json.dumps(res.json(), indent=4))
# 安装runner # 安装runner
# res = requests.get('http://localhost:5000/install/runner/') res = requests.get('http://localhost:5000/install/runner/')
# print(json.dumps(res.json(), indent=4)) print(json.dumps(res.json(), indent=4))
# # 回滚升级 # 回滚升级
# res = requests.get('http://localhost:5000/upgrade/rollback/1238022723059486720/') res = requests.get('http://localhost:5000/upgrade/rollback/1238022723059486720/')
# print(json.dumps(res.json(), indent=4)) print(json.dumps(res.json(), indent=4))
# 远程升级 # 远程升级
res = requests.get('http://localhost:5000/upgrade/remote/') res = requests.get('http://localhost:5000/upgrade/remote/')
......
...@@ -22,7 +22,8 @@ class InfoService(HSBaseUCService): ...@@ -22,7 +22,8 @@ class InfoService(HSBaseUCService):
def get_app_list(self): def get_app_list(self):
project_info = ConnectionService().get_project_info() project_info = ConnectionService().get_project_info()
if not project_info: if not project_info:
raise HSException('请先设置项目信息') # raise HSException('请先设置项目信息')
return []
host_ip = project_info.get('host_ip') host_ip = project_info.get('host_ip')
# host_ip = 'localhost' # host_ip = 'localhost'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment