Skip to content
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