Revert "Merge pull request #4874 from leth/editable_install"

This reverts commit 15b89b45e1, reversing
changes made to 3d836a1ab7.
This commit is contained in:
James Tanner 2013-12-16 15:57:03 -05:00
parent 53a3671df4
commit f3a4705a9c
2 changed files with 13 additions and 25 deletions

View file

@ -82,13 +82,13 @@ p = load_config_file()
active_user = pwd.getpwuid(os.geteuid())[0] active_user = pwd.getpwuid(os.geteuid())[0]
DIST_MODULE_PATH = os.path.join(sys.prefix, 'share/ansible/') # Needed so the RPM can call setup.py and have modules land in the
EDITABLE_MODULE_PATH = os.path.normpath( # correct location. See #1277 for discussion
os.path.join(os.path.dirname(__file__), '../../library')) if getattr(sys, "real_prefix", None):
# in a virtualenv
if not os.path.exists(DIST_MODULE_PATH) \ DIST_MODULE_PATH = os.path.join(sys.prefix, 'share/ansible/')
and os.path.exists(EDITABLE_MODULE_PATH): else:
DIST_MODULE_PATH = EDITABLE_MODULE_PATH DIST_MODULE_PATH = '/usr/share/ansible/'
# check all of these extensions when looking for yaml files for things like # check all of these extensions when looking for yaml files for things like
# group variables # group variables

View file

@ -4,27 +4,15 @@ import os
import sys import sys
from glob import glob from glob import glob
def rel(f): sys.path.insert(0, os.path.abspath('lib'))
return os.path.join(os.path.dirname(__file__), f)
sys.path.insert(0, rel('lib'))
from ansible import __version__, __author__ from ansible import __version__, __author__
from distutils.core import setup from distutils.core import setup
# Needed so the RPM can call setup.py and have modules land in the # find library modules
# correct location. See #1277 for discussion from ansible.constants import DEFAULT_MODULE_PATH
if getattr(sys, "real_prefix", None): dirs=os.listdir("./library/")
# in a virtualenv
DEFAULT_MODULE_PATH = os.path.join(sys.prefix, 'share/ansible/library')
else:
DEFAULT_MODULE_PATH = '/usr/share/ansible/library'
module_path = DEFAULT_MODULE_PATH
if not os.path.exists(DEFAULT_MODULE_PATH):
module_path = rel('library')
data_files = [] data_files = []
for i in os.listdir(module_path): for i in dirs:
data_files.append((os.path.join(DEFAULT_MODULE_PATH, i), glob('./library/' + i + '/*'))) data_files.append((os.path.join(DEFAULT_MODULE_PATH, i), glob('./library/' + i + '/*')))
setup(name='ansible', setup(name='ansible',
@ -35,7 +23,7 @@ setup(name='ansible',
url='http://ansibleworks.com/', url='http://ansibleworks.com/',
license='GPLv3', license='GPLv3',
install_requires=['paramiko', 'jinja2', "PyYAML"], install_requires=['paramiko', 'jinja2', "PyYAML"],
package_dir={ '': 'lib' }, package_dir={ 'ansible': 'lib/ansible' },
packages=[ packages=[
'ansible', 'ansible',
'ansible.utils', 'ansible.utils',