Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
slivingston committed Sep 2, 2024
1 parent 3737d6b commit e9989cf
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions rerobots/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def get_access_rules(self, wdeployment_id=None, to_user=None):
else:
try:
payload = res.json()
except:
except requests.exceptions.JSONDecodeError:
raise Error(res.text)
if 'error_message' in payload:
if payload['error_message'] == 'wrong authorization token':
Expand Down Expand Up @@ -310,7 +310,7 @@ def get_instances(self, include_terminated=False, page=None, max_per_page=None):
else:
try:
payload = res.json()
except:
except requests.exceptions.JSONDecodeError:
raise Error(res.text)
if 'error_message' in payload:
if payload['error_message'] == 'wrong authorization token':
Expand All @@ -337,7 +337,7 @@ def get_instance_info(self, instance_id):
else:
try:
payload = res.json()
except:
except requests.exceptions.JSONDecodeError:
raise Error(res.text)
if 'error_message' in payload:
if payload['error_message'] == 'instance not found':
Expand All @@ -358,7 +358,7 @@ def terminate_instance(self, instance_id):
if not res.ok:
try:
payload = res.json()
except:
except requests.exceptions.JSONDecodeError:
raise Error(res.text)
if 'result_message' in payload:
errmsg = payload['result_message']
Expand Down Expand Up @@ -414,7 +414,7 @@ def request_instance(
else:
try:
payload = res.json()
except:
except requests.exceptions.JSONDecodeError:
raise Error('Response {}: {}'.format(res.status_code, res.content))
errmsg = payload.get('result_message', None)
if errmsg is None:
Expand Down Expand Up @@ -831,7 +831,7 @@ def get_ci_projects(self):
else:
try:
payload = res.json()
except:
except requests.exceptions.JSONDecodeError:
raise Error(res.text)
if 'error_message' in payload:
if payload['error_message'] == 'wrong authorization token':
Expand All @@ -856,7 +856,7 @@ def create_ci_project(self, repo_url):
else:
try:
payload = res.json()
except:
except requests.exceptions.JSONDecodeError:
raise Error(res.text)
if 'error_message' in payload:
if payload['error_message'] == 'wrong authorization token':
Expand All @@ -883,7 +883,7 @@ def submit_ci_job(self, pid, branch, ref):
raise Error('not found')
try:
payload = res.json()
except:
except requests.exceptions.JSONDecodeError:
raise Error(res.text)
if 'error_message' in payload:
if payload['error_message'] == 'wrong authorization token':
Expand Down

0 comments on commit e9989cf

Please sign in to comment.