[tool] Fix 404 error message check in delete_*_branch.py
Gitea API has changed and now 404 for branch search gives back a
shorter error message [1]. tools/delete_*_branch.py script has to
be updated to only match for the new message.
[1] ERROR: (404): {"errors":null,"message":"not found","url":"https://opendev.org/api/swagger"}
Change-Id: I99813e63f8d9f04557da9a37bb41a30d21075701
Signed-off-by: Előd Illés <elod.illes@est.tech>
This commit is contained in:
@@ -69,7 +69,7 @@ def is_branch_open(project_name, branch_id, quiet):
|
||||
print(f'stable/{branch_id} exists in {project_name}.')
|
||||
return 0
|
||||
elif ((response.status_code == 404) and
|
||||
(response_details['message'] == "The target couldn't be found.")):
|
||||
(response_details['message'] == "not found")):
|
||||
if not quiet:
|
||||
print(f'stable/{branch_id} does not exist in {project_name}.')
|
||||
return 1
|
||||
|
||||
@@ -69,7 +69,7 @@ def is_branch_open(project_name, branch_id, quiet):
|
||||
print(f'unmaintained/{branch_id} exists in {project_name}.')
|
||||
return 0
|
||||
elif ((response.status_code == 404) and
|
||||
(response_details['message'] == "The target couldn't be found.")):
|
||||
(response_details['message'] == "not found")):
|
||||
if not quiet:
|
||||
print(f'unmaintained/{branch_id} does not exist in {project_name}.')
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user