summaryrefslogtreecommitdiff
path: root/hacking
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2016-11-02 14:47:42 -0700
committerMatt Clay <matt@mystile.com>2016-11-02 17:00:27 -0700
commit0d46805979646ce3a6f0225e804a73f552cd5296 (patch)
tree8a92e9b753c193ba81ee588573de370537bdcda7 /hacking
parent702ac436dc1b1c4c4d64ce9971d670a1df4308a4 (diff)
downloadansible-0d46805979646ce3a6f0225e804a73f552cd5296.tar.gz
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.
Diffstat (limited to 'hacking')
-rwxr-xr-xhacking/update_bundled.py4
-rwxr-xr-xhacking/yamlcheck.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/hacking/update_bundled.py b/hacking/update_bundled.py
index 53b7a73a90..714c2a3d8b 100755
--- a/hacking/update_bundled.py
+++ b/hacking/update_bundled.py
@@ -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'],
diff --git a/hacking/yamlcheck.py b/hacking/yamlcheck.py
index c66d70db13..68d796cb1a 100755
--- a/hacking/yamlcheck.py
+++ b/hacking/yamlcheck.py
@@ -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