summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemi Ferrand <remi.ferrand@cc.in2p3.fr>2014-07-23 17:25:18 +0200
committerRemi Ferrand <remi.ferrand@cc.in2p3.fr>2014-07-23 17:28:20 +0200
commit2fc900dbf8d98dcf48677112ae33951347e216ed (patch)
tree224b85b89a84b9e5be4aa03e796a6063ac4e381d
parentf01567c877e574264bd9b8816f640203b0e563b0 (diff)
Handle case when virtualenv_version fact is not available.
As specified in #94, when their is no way to find virtualenv version, fall back to user request. When fact virtualenv_version is not yet available, stupidly trust user input and force systempkgs options without taking care of virtualenv veresion. 1. If the option choosen is not recognized by the installed version of virtualenv, further Exec will fail and dependencies will not be processed. 2. On the next puppet execution, fact _virtualenv_version_ will be available and process should work as expected.
-rw-r--r--manifests/virtualenv.pp6
1 files changed, 5 insertions, 1 deletions
diff --git a/manifests/virtualenv.pp b/manifests/virtualenv.pp
index 769c5a8..d3bc3b5 100644
--- a/manifests/virtualenv.pp
+++ b/manifests/virtualenv.pp
@@ -108,7 +108,11 @@ define python::virtualenv (
} elsif (( versioncmp($::virtualenv_version,'1.7') < 0 ) and ( $systempkgs == false )) {
$system_pkgs_flag = '--no-site-packages'
} else {
- $system_pkgs_flag = ''
+ $system_pkgs_flag = $systempkgs ? {
+ true => '--system-site-packages',
+ false => '--no-site-packages',
+ default => fail('Invalid value for systempkgs. Boolean value is expected')
+ }
}
$distribute_pkg = $distribute ? {