Skip to content

Commit

Permalink
Handle case when virtualenv_version fact is not available.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
riton committed Jul 23, 2014
1 parent 01464f3 commit 5b35f19
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion manifests/virtualenv.pp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@
} 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 ? {
Expand Down

0 comments on commit 5b35f19

Please sign in to comment.