summaryrefslogtreecommitdiff
path: root/hacking
diff options
context:
space:
mode:
authorToshio Kuratomi <a.badger@gmail.com>2019-02-05 10:18:00 -0800
committerToshio Kuratomi <a.badger@gmail.com>2019-02-06 13:59:55 -0800
commitdfd8b659c0fbf9032e2ca24c0e36bd8755d27614 (patch)
tree738152cb2644312c44c4ebacec848460340a05ae /hacking
parent2c0897caf2b2fe6eecc2361f4fd5446ba1991105 (diff)
downloadansible-dfd8b659c0fbf9032e2ca24c0e36bd8755d27614.tar.gz
Have update-bundled check for updates to all bundled code
Add a test for whether we have bundled code inside of ansible that needs to be updated
Diffstat (limited to 'hacking')
-rwxr-xr-xhacking/update_bundled.py34
1 files changed, 0 insertions, 34 deletions
diff --git a/hacking/update_bundled.py b/hacking/update_bundled.py
deleted file mode 100755
index 02bf6c118d..0000000000
--- a/hacking/update_bundled.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env python
-
-import glob
-import json
-import os.path
-from distutils.version import LooseVersion
-
-from ansible.module_utils.urls import open_url
-
-basedir = os.path.dirname(__file__)
-
-for filename in glob.glob(os.path.join(basedir, '../lib/ansible/compat/*/__init__.py')):
- if 'compat/tests' in filename:
- # compat/tests doesn't bundle any code
- continue
-
- filename = os.path.normpath(filename)
- with open(filename, 'r') as module:
- for line in module:
- if line.strip().startswith('_BUNDLED_METADATA'):
- data = line[line.index('{'):].strip()
- break
- else:
- print('WARNING: {0} contained no metadata. Could not check for updates'.format(filename))
- continue
- metadata = json.loads(data)
- pypi_fh = open_url('https://pypi.org/pypi/{0}/json'.format(metadata['pypi_name']))
- pypi_data = json.loads(pypi_fh.read().decode('utf-8'))
- if LooseVersion(metadata['version']) < LooseVersion(pypi_data['info']['version']):
- print('UPDATE: {0} from {1} to {2} {3}'.format(
- metadata['pypi_name'],
- metadata['version'],
- pypi_data['info']['version'],
- 'https://pypi.org/pypi/{0}/json'.format(metadata['pypi_name'])))