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

add SCL specific exec_prefix #283

Merged
merged 1 commit into from
Jan 18, 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
13 changes: 12 additions & 1 deletion manifests/pip.pp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@
$path = ['/usr/local/bin','/usr/bin','/bin', '/usr/sbin'],
) {

$python_provider = getparam(Class['python'], 'provider')
$python_version = getparam(Class['python'], 'version')

# Get SCL exec prefix
# NB: this will not work if you are running puppet from scl enabled shell
$exec_prefix = $python_provider ? {
'scl' => "scl enable ${python_version} -- ",
'rhscl' => "scl enable ${python_version} -- ",
default => '',
}

# Parameter validation
if ! $virtualenv {
fail('python::pip: virtualenv parameter must not be empty')
Expand All @@ -105,7 +116,7 @@
}

$pip_env = $virtualenv ? {
'system' => 'pip',
'system' => "${exec_prefix}pip",
default => "${virtualenv}/bin/pip",
}

Expand Down