Merge ~aixtools/cloud-init:hash-bang into cloud-init:master
Proposed by
Michael Felt
Status: | Work in progress |
---|---|
Proposed branch: | ~aixtools/cloud-init:hash-bang |
Merge into: | cloud-init:master |
Diff against target: |
52 lines (+4/-5) 5 files modified
cloudinit/cmd/main.py (+0/-1) doc/rtd/topics/format.rst (+1/-1) tools/ccfg-merge-debug (+1/-1) tools/make-mime.py (+1/-1) tools/mock-meta.py (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Scott Moser | Needs Fixing | ||
Server Team CI bot | continuous-integration | Approve | |
Review via email: mp+315610@code.launchpad.net |
Commit message
behavior: Use #!/usr/bin/env python to call python
For files that are intended to be executed make sure python is called
via the current environment rather than expect the correct python to
always be located at /usr/bin/python.
Note: several tools were already using this convention - this only makes
the style uniform - and updates the docs with this convention
Description of the change
unifies using "#!/usr/bin/env python" for cloud-init files that are intended to be executed.
Not only does this remove an assumption that python always exists in /usr/bin, it also permits
using/testing an alternate python by modifying the environment before cloud-init (tools) are called.
To post a comment you must log in.
the one thing that sucks about this is that virtualenv tries to help by making 'python3' have a name 'python'.
$ tox-venv py3 python --version
Python 3.5.3rc1
the change you've suggested here is probably right, but i really hate that it opens us up to getting the wrong python. (Ie, my feeling is that /usr/bin/python is and always will be python 2, where '/usr/bin/env python' might be python3).
most of that is rant, but the short result is that you now have to verify that the things you've changed from 'python' (python2) to 'env python' (python2 or python3) are python3 compatible.
Can you verify that ?