From 95747cdbb5e5e7378fd2a8f74a01f0d44bf90e74 Mon Sep 17 00:00:00 2001 From: Steven Pecht Date: Wed, 7 May 2014 14:18:26 -0400 Subject: Added timeout option to python::pip The default timeout is set to 1800. The same default as virtual environement installations. A timeout parameter is needed for long running installs such as SciPy. --- README.md | 3 +++ manifests/pip.pp | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 444b3b7..3632cd8 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,8 @@ Installs and manages packages from pip. **uninstall_args** - Array of additional flags to pass to pip during uninstall. Default: none +**timeout** - Timeout for the pip install command. Defaults to 1800. + python::pip { 'cx_Oracle': pkgname => 'cx_Oracle', virtualenv => '/var/www/project1', @@ -77,6 +79,7 @@ Installs and manages packages from pip. proxy => 'http://proxy.domain.com:3128', environment => 'ORACLE_HOME=/usr/lib/oracle/11.2/client64', install_args => ['-e'], + timeout => 1800, } ### python::requirements diff --git a/manifests/pip.pp b/manifests/pip.pp index a0c0eb4..2cb5bd5 100644 --- a/manifests/pip.pp +++ b/manifests/pip.pp @@ -31,6 +31,9 @@ # [*environment*] # Additional environment variables required to install the packages. Default: none # +# [*timeout*] +# The maximum time in seconds the "pip install" command should take. Default: 1800 +# # [*install_args*] # String. Any additional installation arguments that will be supplied # when running pip install. @@ -63,6 +66,7 @@ define python::pip ( $environment = [], $install_args = '', $uninstall_args = '', + $timeout = 1800, ) { # Parameter validation @@ -150,6 +154,7 @@ define python::pip ( user => $owner, environment => $environment, path => ['/usr/local/bin','/usr/bin','/bin', '/usr/sbin'], + timeout => $timeout, } } @@ -161,6 +166,7 @@ define python::pip ( user => $owner, environment => $environment, path => ['/usr/local/bin','/usr/bin','/bin', '/usr/sbin'], + timeout => $timeout, } } @@ -172,6 +178,7 @@ define python::pip ( user => $owner, environment => $environment, path => ['/usr/local/bin','/usr/bin','/bin', '/usr/sbin'], + timeout => $timeout, } } @@ -183,6 +190,7 @@ define python::pip ( user => $owner, environment => $environment, path => ['/usr/local/bin','/usr/bin','/bin', '/usr/sbin'], + timeout => $timeout, } } } -- cgit v1.2.3