Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix installing to virtualenvs. #1509

Merged
merged 2 commits into from
Nov 3, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/ansible/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import os
import pwd
import sys
import ConfigParser

def get_config(p, section, key, env_var, default):
Expand Down Expand Up @@ -60,7 +61,10 @@ def shell_expand_path(path):

# 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/'
if getattr(sys, "real_prefix", None):
DIST_MODULE_PATH = os.path.join(sys.prefix, 'share/ansible/')
else:
DIST_MODULE_PATH = '/usr/share/ansible/'

# sections in config file
DEFAULTS='defaults'
Expand Down