From f36c656e0e2a91a21673aada09eba2d45b37a7d5 Mon Sep 17 00:00:00 2001 From: fly Date: Thu, 27 May 2021 09:21:48 +0200 Subject: [PATCH] Fixed api_get_status Signed-off-by: fly --- common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common.py b/common.py index 021814e..30286e4 100644 --- a/common.py +++ b/common.py @@ -219,9 +219,9 @@ def api_get_status(name, api, api_token): try: match = re.match(r"[ew]\d{3}[ns]\d{2}", name) if match != None: - response = requests.post(api, data={'auth': token, 'action': 'status', 'area': name}, headers={"lAccept": "application/json", "Content-Type": "application/x-www-form-urlencoded"}) + response = requests.post(api, data={'auth': api_token, 'action': 'status', 'area': name}, headers={"lAccept": "application/json", "Content-Type": "application/x-www-form-urlencoded"}) else: - response = requests.post(api, data={'auth': token, 'action': 'status', 'tile': name}, headers={"lAccept": "application/json", "Content-Type": "application/x-www-form-urlencoded"}) + response = requests.post(api, data={'auth': api_token, 'action': 'status', 'tile': name}, headers={"lAccept": "application/json", "Content-Type": "application/x-www-form-urlencoded"}) if response.ok and response.json()["success"] == True: match = re.match(r"pending|done|rebuild|skip|started|packaged", response.json()["status"]) if match != None: