summaryrefslogtreecommitdiff
path: root/manifests/requirements.pp
diff options
context:
space:
mode:
authorFotis Gimian <fgimiansoftware@gmail.com>2013-06-03 23:13:50 +1000
committerFotis Gimian <fgimiansoftware@gmail.com>2013-06-03 23:13:50 +1000
commit1aaef848f4a52d83a6b44eeb4cffd9b61a665c41 (patch)
treee064a68f8ddcdbad835dc1f561cd74fa4e832300 /manifests/requirements.pp
parentf6fd9f46fe9c058d1f0877043d42829efe0c45cb (diff)
Made system virtualenv more robust and ensured that pip logging would occur in an appropriate directory upon failure to avoid errors
Diffstat (limited to 'manifests/requirements.pp')
-rw-r--r--manifests/requirements.pp9
1 files changed, 6 insertions, 3 deletions
diff --git a/manifests/requirements.pp b/manifests/requirements.pp
index 8b94839..3019a46 100644
--- a/manifests/requirements.pp
+++ b/manifests/requirements.pp
@@ -33,9 +33,13 @@ define python::requirements (
$group = 'root'
) {
+ if $virtualenv == 'system' and ($owner != 'root' or $group != 'root') {
+ fail('python::pip: root user must be used when virtualenv is system')
+ }
+
$cwd = $virtualenv ? {
'system' => '/',
- default => "${virtualenv}/bin/",
+ default => "${virtualenv}",
}
$pip_env = $virtualenv ? {
@@ -64,8 +68,7 @@ define python::requirements (
exec { "python_requirements${name}":
provider => shell,
- command => "${pip_env} install ${proxy_flag} -r ${requirements}",
- cwd => $cwd,
+ command => "${pip_env} --log-file ${cwd}/pip.log install ${proxy_flag} -r ${requirements}",
refreshonly => true,
timeout => 1800,
user => $owner,