1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Update additional pypi.python.org URLs to pypi.org (#41373)

For details on the new PyPI, see the blog post:

https://pythoninsider.blogspot.ca/2018/04/new-pypi-launched-legacy-pypi-shutting.html
This commit is contained in:
Jon Dufresne 2018-06-17 05:01:18 -07:00 committed by René Moser
parent ad8142fc6d
commit dc7e50fa90
2 changed files with 3 additions and 3 deletions

View file

@ -13,7 +13,7 @@ Ansible contains a number of extra modules for interacting with CloudStack based
Prerequisites Prerequisites
````````````` `````````````
Prerequisites for using the CloudStack modules are minimal. In addition to Ansible itself, all of the modules require the python library ``cs`` https://pypi.python.org/pypi/cs. Prerequisites for using the CloudStack modules are minimal. In addition to Ansible itself, all of the modules require the python library ``cs`` https://pypi.org/project/cs/
You'll need this Python module installed on the execution host, usually your workstation. You'll need this Python module installed on the execution host, usually your workstation.

View file

@ -24,11 +24,11 @@ for filename in glob.glob(os.path.join(basedir, '../lib/ansible/compat/*/__init_
print('WARNING: {0} contained no metadata. Could not check for updates'.format(filename)) print('WARNING: {0} contained no metadata. Could not check for updates'.format(filename))
continue continue
metadata = json.loads(data) metadata = json.loads(data)
pypi_fh = open_url('https://pypi.python.org/pypi/{0}/json'.format(metadata['pypi_name'])) pypi_fh = open_url('https://pypi.org/pypi/{0}/json'.format(metadata['pypi_name']))
pypi_data = json.loads(pypi_fh.read().decode('utf-8')) pypi_data = json.loads(pypi_fh.read().decode('utf-8'))
if LooseVersion(metadata['version']) < LooseVersion(pypi_data['info']['version']): if LooseVersion(metadata['version']) < LooseVersion(pypi_data['info']['version']):
print('UPDATE: {0} from {1} to {2} {3}'.format( print('UPDATE: {0} from {1} to {2} {3}'.format(
metadata['pypi_name'], metadata['pypi_name'],
metadata['version'], metadata['version'],
pypi_data['info']['version'], pypi_data['info']['version'],
'https://pypi.python.org/pypi/{0}/'.format(metadata['pypi_name']))) 'https://pypi.org/pypi/{0}/json'.format(metadata['pypi_name'])))