Commit 4fee601a authored by 赵凯's avatar 赵凯 💬

fix

parent 738173be
...@@ -78,14 +78,23 @@ def tasksPatch(taskid): ...@@ -78,14 +78,23 @@ def tasksPatch(taskid):
'cookie': cookie 'cookie': cookie
} }
response = requests.request("PATCH", url, headers=headers, data=payload) response = requests.request("PATCH", url, headers=headers, data=payload)
print(response) # Check if request was successful
rst = json.loads(response.text) if response.status_code == 200:
print(response) # Do something with the response data if needed
response_data = response.json()
print(response_data)
return response_data
else:
# Handle potential errors
response.raise_for_status()
print("debug - 执行异常,退出")
# print("任务开始执行...") # print("任务开始执行...")
# if rst['code'] == -1: # if rst['code'] == -1:
# print("任务执行异常:" + rst['msg']) # print("任务执行异常:" + rst['msg'])
# 集群部署任务 # 集群部署任务
def taskMultiZone(taskid, target_k8): def taskMultiZone(taskid, target_k8):
cookie = getToken() cookie = getToken()
......
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