diff options
author | Tim Bielawa <tbielawa@redhat.com> | 2012-10-11 13:22:30 -0400 |
---|---|---|
committer | Tim Bielawa <tbielawa@redhat.com> | 2012-10-11 13:22:30 -0400 |
commit | baa91ebc95a36636aca55f0de8055bcf17145090 (patch) | |
tree | f5c8a8f38f02c0c1c72ad080df306602ec519d8f | |
parent | f3d7294690893160184d48fbe2f71d9ea8890605 (diff) | |
download | ansible-baa91ebc95a36636aca55f0de8055bcf17145090.tar.gz |
Add DIST_MODULE_PATH so setup.py and ansible.spec can live in harmony. Closes #1277
-rw-r--r-- | lib/ansible/constants.py | 6 | ||||
-rw-r--r-- | setup.py | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py index dffcc24105..782bd1254e 100644 --- a/lib/ansible/constants.py +++ b/lib/ansible/constants.py @@ -60,12 +60,16 @@ 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 +DIST_MODULE_PATH = '/usr/share/ansible/' + # sections in config file DEFAULTS='defaults' # configurable things DEFAULT_HOST_LIST = shell_expand_path(get_config(p, DEFAULTS, 'hostfile', 'ANSIBLE_HOSTS', '/etc/ansible/hosts')) -DEFAULT_MODULE_PATH = shell_expand_path(get_config(p, DEFAULTS, 'library', 'ANSIBLE_LIBRARY', '/usr/share/ansible')) +DEFAULT_MODULE_PATH = shell_expand_path(get_config(p, DEFAULTS, 'library', 'ANSIBLE_LIBRARY', DIST_MODULE_PATH)) DEFAULT_REMOTE_TMP = shell_expand_path(get_config(p, DEFAULTS, 'remote_tmp', 'ANSIBLE_REMOTE_TEMP', '$HOME/.ansible/tmp')) DEFAULT_MODULE_NAME = get_config(p, DEFAULTS, 'module_name', None, 'command') DEFAULT_PATTERN = get_config(p, DEFAULTS, 'pattern', None, '*') @@ -9,8 +9,8 @@ from ansible import __version__, __author__ from distutils.core import setup # find library modules -from ansible.constants import DEFAULT_MODULE_PATH -data_files = [ (DEFAULT_MODULE_PATH, glob('./library/*')) ] +from ansible.constants import DIST_MODULE_PATH +data_files = [ (DIST_MODULE_PATH, glob('./library/*')) ] print "DATA FILES=%s" % data_files |