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 virtualenv behavior when requirements files are in subdirectories #34946

Merged
merged 2 commits into from
Jul 27, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions salt/modules/pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,13 @@ def _process_requirements(requirements, cmd, cwd, saltenv, user):
logger.info('request files: {0}'.format(str(reqs)))

for req_file in reqs:
if not os.path.isabs(req_file):
req_file = os.path.join(cwd, req_file)

req_filename = os.path.basename(req_file)
logger.debug('TREQ N CWD: %s -- %s -- for %s', str(treq), str(cwd), str(req_file))
target_path = os.path.join(treq, os.path.basename(req_file))

logger.debug('TREQ N CWD: %s -- %s -- for %s', str(treq), str(cwd), str(req_filename))
source_path = os.path.join(cwd, req_filename)
target_path = os.path.join(treq, req_filename)

logger.debug('S: %s', source_path)
logger.debug('S: %s', req_file)
logger.debug('T: %s', target_path)

target_base = os.path.dirname(target_path)
Expand All @@ -307,9 +306,9 @@ def _process_requirements(requirements, cmd, cwd, saltenv, user):

if not os.path.exists(target_path):
logger.debug(
'Copying %s to %s', source_path, target_path
'Copying %s to %s', req_file, target_path
)
__salt__['file.copy'](source_path, target_path)
__salt__['file.copy'](req_file, target_path)

logger.debug(
'Changing ownership of requirements file \'{0}\' to '
Expand Down