mirror of
https://github.com/YunoHost/yunodevtools.git
synced 2024-09-03 20:16:19 +02:00
refactor(clone_packages): rename variable
This commit is contained in:
parent
5a2c9ca8e7
commit
cc3330a278
1 changed files with 5 additions and 5 deletions
|
@ -71,24 +71,24 @@ def generate_mirrors():
|
||||||
"service": "github",
|
"service": "github",
|
||||||
}
|
}
|
||||||
|
|
||||||
create_mirror = requests.post(
|
create_mirror_request = requests.post(
|
||||||
"https://git.yunohost.org/api/v1/repos/migrate",
|
"https://git.yunohost.org/api/v1/repos/migrate",
|
||||||
headers=api_header,
|
headers=api_header,
|
||||||
params=f"access_token={FORGEJO_TOKEN}",
|
params=f"access_token={FORGEJO_TOKEN}",
|
||||||
json=create_mirror_data,
|
json=create_mirror_data,
|
||||||
)
|
)
|
||||||
|
|
||||||
if create_mirror.status_code == 409:
|
if create_mirror_request.status_code == 409:
|
||||||
print(f"A repo named '{repo_name}' is already existing.")
|
print(f"A repo named '{repo_name}' is already existing.")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if create_mirror.status_code == 422:
|
if create_mirror_request.status_code == 422:
|
||||||
print("We're rate limited. Waiting for 1 minute before continuing.")
|
print("We're rate limited. Waiting for 1 minute before continuing.")
|
||||||
time.sleep(60)
|
time.sleep(60)
|
||||||
|
|
||||||
if create_mirror.status_code not in (201, 422):
|
if create_mirror_request.status_code not in (201, 422):
|
||||||
raise Exception(
|
raise Exception(
|
||||||
"Request failed:", create_mirror.status_code, create_mirror.text
|
"Request failed:", create_mirror_request.status_code, create_mirror_request.text
|
||||||
)
|
)
|
||||||
|
|
||||||
# configuring properly the new repository
|
# configuring properly the new repository
|
||||||
|
|
Loading…
Add table
Reference in a new issue