diff options
author | Salimane Adjao Moustapha <me@salimane.com> | 2013-04-19 18:11:14 +0800 |
---|---|---|
committer | Salimane Adjao Moustapha <me@salimane.com> | 2013-04-19 18:17:26 +0800 |
commit | 8b22e3ecd90dd3ac741ff107d6f3fc8c511443ba (patch) | |
tree | 25d641a1e8264bc5141b0204fa4a87f6be5f98df | |
parent | a209fb9a0e6bc6100df0ebc3323e1ec8eab80bbc (diff) |
fix python::requirements Error: Parameter cwd failed on Exec and command not found
-rw-r--r-- | manifests/requirements.pp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/manifests/requirements.pp b/manifests/requirements.pp index 22988e5..cae32bf 100644 --- a/manifests/requirements.pp +++ b/manifests/requirements.pp @@ -31,6 +31,11 @@ define python::requirements ( $proxy = false ) { + $cwd = $virtualenv ? { + 'system' => '/', + default => "${virtualenv}/bin/pip", + } + $pip_env = $virtualenv ? { 'system' => '`which pip`', default => "${virtualenv}/bin/pip", @@ -46,7 +51,7 @@ define python::requirements ( # This will ensure multiple python::virtualenv definitions can share the # the same requirements file. if !defined(File[$requirements]) { - file { $requirements: + file { $requirements: ensure => present, mode => '0644', owner => 'root', @@ -64,8 +69,9 @@ define python::requirements ( } exec { "python_requirements_update_${name}": + provider => shell, command => "${pip_env} install ${proxy_flag} -Ur ${requirements}", - cwd => $virtualenv, + cwd => $cwd, refreshonly => true, timeout => 1800, subscribe => Exec["python_requirements_check_${name}"], |