Skip to content

Commit 772d8f4

Browse files
committed
Use python -m pip to work around a permissions issue on Windows
1 parent 8f848d4 commit 772d8f4

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

manifests/params.pp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@
4646
default => 'gunicorn',
4747
}
4848

49+
if $::operatingsystem == 'windows' {
50+
$python_executable = 'python.exe'
51+
}
52+
4953
$pip_provider = $::operatingsystem ? {
50-
'windows' => 'pip.exe',
54+
'windows' => "${python_executable} -m pip",
5155
default => 'pip',
5256
}
5357

manifests/pip.pp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@
226226
" | tr -d '[:space:]'"])
227227
$unless_command = "[ \$(${latest_version}) = \$(${installed_version}) ]"
228228
} else {
229-
$unless_command = join(["${python_env}/python.exe -c \"",
229+
$python_executable = getvar('python::params::python_executable')
230+
$unless_command = join(["${python_env}/${python_executable} -c \"",
230231
"import subprocess;",
231232
"import sys;",
232233
"import re;",

0 commit comments

Comments
 (0)