Ignore 500 status code in generate plugin script

Due to various reasons, this script may encounter the
500 status code from some repo (x/fuel-plugin-onos in current case[1])
If that happen then it return failure status code to the
propose-updates job and fail that job

- https://zuul.openstack.org/builds?job_name=propose-updates&project=openstack%2Fdevstack&skip=0

It is better not to raise the 500 error in this script and just ignore those
repo to process further to detect the plugin.

[1] https://zuul.openstack.org/build/dba0aa41d145472397916dfcd13948de/log/job-output.txt#2442

Change-Id: Ibca0a2aac404161340e8fc00170018eecf5c8326
This commit is contained in:
Ghanshyam Mann 2024-03-05 08:30:19 -08:00
parent 57c685496f
commit 1fe7707cf0

View File

@ -73,8 +73,11 @@ logging.debug("Found %d projects" % len(projects))
s = requests.Session() s = requests.Session()
# sometimes gitea gives us a 500 error; retry sanely # sometimes gitea gives us a 500 error; retry sanely
# https://stackoverflow.com/a/35636367 # https://stackoverflow.com/a/35636367
# We need to disable raise_on_status because if any repo endup with 500 then
# propose-updates job which run this script will fail.
retries = Retry(total=3, backoff_factor=1, retries = Retry(total=3, backoff_factor=1,
status_forcelist=[ 500 ]) status_forcelist=[ 500 ],
raise_on_status=False)
s.mount('https://', HTTPAdapter(max_retries=retries)) s.mount('https://', HTTPAdapter(max_retries=retries))
found_plugins = filter(functools.partial(has_devstack_plugin, s), projects) found_plugins = filter(functools.partial(has_devstack_plugin, s), projects)