diff options
author | Marc Abramowitz <marca@surveymonkey.com> | 2014-07-30 22:35:11 +0200 |
---|---|---|
committer | Marc Abramowitz <marca@surveymonkey.com> | 2014-07-30 22:35:11 +0200 |
commit | 44b9f5e752b6f66a2450a5ec3c5c2625cefa6a14 (patch) | |
tree | abe188b144c36d68cb97b541b5e1b1f658d70b18 /bin/ansible-playbook | |
parent | Remove whitespace around args (diff) | |
download | ansible-44b9f5e752b6f66a2450a5ec3c5c2625cefa6a14.tar.xz ansible-44b9f5e752b6f66a2450a5ec3c5c2625cefa6a14.zip |
Make `pip install -e` work
This allows `pip install -e` and `python setup.py develop` to work
without having to do the stuff in
http://docs.ansible.com/intro_installation.html#running-from-source so
it's a tad nicer for Python programmers who are accustomed to installing
packages as editable/in development mode.
Fixes GH-8355 (https://github.com/ansible/ansible/issues/8355)
Diffstat (limited to 'bin/ansible-playbook')
-rwxr-xr-x | bin/ansible-playbook | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/ansible-playbook b/bin/ansible-playbook index 3d05d8e29c..91fd279b62 100755 --- a/bin/ansible-playbook +++ b/bin/ansible-playbook @@ -25,6 +25,14 @@ import sys import os import stat +# Augment PYTHONPATH to find Python modules relative to this file path +# This is so that we can find the modules when running from a local checkout +# installed as editable with `pip install -e ...` or `python setup.py develop` +local_module_path = os.path.abspath( + os.path.join(os.path.dirname(__file__), '..', 'lib') +) +sys.path.append(local_module_path) + import ansible.playbook import ansible.constants as C import ansible.utils.template |