diff options
author | jctanner <tanner.jc@gmail.com> | 2013-12-16 11:22:45 -0800 |
---|---|---|
committer | jctanner <tanner.jc@gmail.com> | 2013-12-16 11:22:45 -0800 |
commit | 15b89b45e1441d4d268b5cc3acca6127b4f38063 (patch) | |
tree | e318141cbf96cdc3f7a02d86522179bfec1918bd /lib | |
parent | 3d836a1ab72b9b07c9159678cf26ad1e2c8d1aee (diff) | |
parent | 8d98a55df165f722654f5f3421a6944091fcb17d (diff) | |
download | ansible-15b89b45e1441d4d268b5cc3acca6127b4f38063.tar.gz |
Merge pull request #4874 from leth/editable_install
Fix setup.py to work with 'pip install -e .'
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ansible/constants.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py index ea1a23a59b..290c995272 100644 --- a/lib/ansible/constants.py +++ b/lib/ansible/constants.py @@ -82,13 +82,13 @@ p = load_config_file() active_user = pwd.getpwuid(os.geteuid())[0] -# Needed so the RPM can call setup.py and have modules land in the -# correct location. See #1277 for discussion -if getattr(sys, "real_prefix", None): - # in a virtualenv - DIST_MODULE_PATH = os.path.join(sys.prefix, 'share/ansible/') -else: - DIST_MODULE_PATH = '/usr/share/ansible/' +DIST_MODULE_PATH = os.path.join(sys.prefix, 'share/ansible/') +EDITABLE_MODULE_PATH = os.path.normpath( + os.path.join(os.path.dirname(__file__), '../../library')) + +if not os.path.exists(DIST_MODULE_PATH) \ + and os.path.exists(EDITABLE_MODULE_PATH): + DIST_MODULE_PATH = EDITABLE_MODULE_PATH # check all of these extensions when looking for yaml files for things like # group variables |