mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Clean up shebangs for various files.
- Remove shebangs from: - ini files - unit tests - module_utils - plugins - module_docs_fragments - non-executable Makefiles - Change non-modules from '/usr/bin/python' to '/usr/bin/env python'. - Change '/bin/env' to '/usr/bin/env'. Also removed main functions from unit tests (since they no longer have a shebang) and fixed a python 3 compatibility issue with update_bundled.py so it does not need to specify a python 2 shebang. A script was added to check for unexpected shebangs in files. This script is run during CI on Shippable.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/python2 -tt
|
||||
#!/usr/bin/env python
|
||||
|
||||
import glob
|
||||
import json
|
||||
@@ -25,7 +25,7 @@ for filename in glob.glob(os.path.join(basedir, '../lib/ansible/compat/*/__init_
|
||||
continue
|
||||
metadata = json.loads(data)
|
||||
pypi_fh = open_url('https://pypi.python.org/pypi/{0}/json'.format(metadata['pypi_name']))
|
||||
pypi_data = json.loads(pypi_fh.read())
|
||||
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'],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/python
|
||||
#!/usr/bin/env python
|
||||
# long version of this one liner: python -c 'import yaml,sys;yaml.safe_load(sys.stdin)' < yamltest.txt
|
||||
import yaml
|
||||
import sys
|
||||
|
||||
Reference in New Issue
Block a user