Merge "Update missing cmd to follow redirects"

This commit is contained in:
Zuul 2020-05-14 16:03:55 +00:00 committed by Gerrit Code Review
commit 7cc9684f3d
2 changed files with 24 additions and 24 deletions

View File

@ -12,9 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
"""Look for releases listed in a series but not actually tagged.
"""
"""Look for releases listed in a series but not actually tagged."""
import argparse
import glob
@ -142,25 +140,26 @@ def main():
print(' apparently not a python module')
continue
wheel_2_errors = list(
wheel_errors = list(
check_url(
'python 2 wheel',
links.wheel_py2_url(version, project)
'python 3 wheel',
links.wheel_py3_url(version, project)
)
)
wheel_both_errors = list(
check_url(
'python 2/3 wheel',
links.wheel_both_url(version, project)
has_23_wheel = False
if wheel_errors:
has_23_wheel = True
# Check if there is actually a 2/3 wheel
wheel_errors = list(
check_url(
'python 2/3 wheel',
links.wheel_both_url(version, project)
)
)
)
# We only expect to find one wheel. Look for both,
# and minimize what we report as errors.
if wheel_2_errors and wheel_both_errors:
# We have neither wheel.
errors.extend(wheel_2_errors)
errors.extend(wheel_both_errors)
elif not wheel_both_errors:
if wheel_errors:
# We are missing the wheel.
errors.extend(wheel_errors)
elif has_23_wheel:
# We have the "both" wheel, so check for the
# signature file.
errors.extend(
@ -170,13 +169,13 @@ def main():
project) + '.asc',
)
)
elif not wheel_2_errors:
# We have the py2 wheel, so check for the
else:
# We have the py3 wheel, so check for the
# signature file.
errors.extend(
check_url(
'python 2 wheel signature',
links.wheel_py2_url(version,
'python 3 wheel signature',
links.wheel_py3_url(version,
project) + '.asc',
)
)

View File

@ -21,6 +21,7 @@ def link_exists(url):
response = requests.head(
url,
headers={'user-agent': 'openstack-release-link-checker'},
allow_redirects=True,
)
missing = (
(response.status_code // 100 != 2) or
@ -43,10 +44,10 @@ def tarball_url(version, project):
)
def wheel_py2_url(version, project):
def wheel_py3_url(version, project):
repo_base = project.repo.base_name
base = project.tarball_base or repo_base
return '{s}/{r}/{n}-{v}-py2-none-any.whl'.format(
return '{s}/{r}/{n}-{v}-py3-none-any.whl'.format(
s='https://tarballs.openstack.org',
v=version,
r=repo_base,