From 80a0c30a369022adbda9e992c10bf6adc376fa20 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Tue, 20 Feb 2018 08:51:39 -0600 Subject: [PATCH] Retry pypi name checking We added logic to change underscores to dashes when checking package names on pypi. Apparently there is a mix of conventions used here as this caused some checks to fail. This changes the check to try the expected sdist name first, and if that fails, try again with the modified name. Change-Id: I8c0f2cd6866f295a622c3ccce9620bf4358327af --- openstack_releases/cmds/validate.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/openstack_releases/cmds/validate.py b/openstack_releases/cmds/validate.py index 4351b9b525..62a373a014 100644 --- a/openstack_releases/cmds/validate.py +++ b/openstack_releases/cmds/validate.py @@ -557,12 +557,15 @@ def validate_pypi_permissions(deliverable_info, zuul_projects, workdir, ) continue - # Names like "openstack_requirements" are translated to - # "openstack-requirements" in the PyPI API. - sdist = sdist.replace('_', '-') print('sdist name {!r}'.format(sdist)) - uploaders = pythonutils.get_pypi_uploaders(sdist) + if not uploaders: + # Names like "openstack_requirements" are translated to + # "openstack-requirements" in the PyPI API. + sdist = sdist.replace('_', '-') + print('retrying with sdist name {!r}'.format(sdist)) + uploaders = pythonutils.get_pypi_uploaders(sdist) + if not uploaders: mk_error( 'could not find users with permission to upload packages '