Browse code

Add DIST_MODULE_PATH so setup.py and ansible.spec can live in harmony. Closes #1277

Tim Bielawa authored on 2012/10/12 02:22:30
Showing 2 changed files
... ...
@@ -60,12 +60,16 @@ p = load_config_file()
60 60
 
61 61
 active_user   = pwd.getpwuid(os.geteuid())[0]
62 62
 
63
+# Needed so the RPM can call setup.py and have modules land in the
64
+# correct location. See #1277 for discussion
65
+DIST_MODULE_PATH = '/usr/share/ansible/'
66
+
63 67
 # sections in config file
64 68
 DEFAULTS='defaults'
65 69
 
66 70
 # configurable things
67 71
 DEFAULT_HOST_LIST         = shell_expand_path(get_config(p, DEFAULTS, 'hostfile',         'ANSIBLE_HOSTS',            '/etc/ansible/hosts'))
68
-DEFAULT_MODULE_PATH       = shell_expand_path(get_config(p, DEFAULTS, 'library',          'ANSIBLE_LIBRARY',          '/usr/share/ansible'))
72
+DEFAULT_MODULE_PATH       = shell_expand_path(get_config(p, DEFAULTS, 'library',          'ANSIBLE_LIBRARY',          DIST_MODULE_PATH))
69 73
 DEFAULT_REMOTE_TMP        = shell_expand_path(get_config(p, DEFAULTS, 'remote_tmp',       'ANSIBLE_REMOTE_TEMP',      '$HOME/.ansible/tmp'))
70 74
 DEFAULT_MODULE_NAME       = get_config(p, DEFAULTS, 'module_name',      None,                       'command')
71 75
 DEFAULT_PATTERN           = get_config(p, DEFAULTS, 'pattern',          None,                       '*')
... ...
@@ -9,8 +9,8 @@ from ansible import __version__, __author__
9 9
 from distutils.core import setup
10 10
 
11 11
 # find library modules
12
-from ansible.constants import DEFAULT_MODULE_PATH
13
-data_files = [ (DEFAULT_MODULE_PATH, glob('./library/*')) ]
12
+from ansible.constants import DIST_MODULE_PATH
13
+data_files = [ (DIST_MODULE_PATH, glob('./library/*')) ]
14 14
 
15 15
 print "DATA FILES=%s" % data_files
16 16