Skip to content

Commit 3fd7d9f

Browse files
author
Diogo de Campos
committed
Added timeout parameter to python::requirements
1 parent fe8841f commit 3fd7d9f

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

manifests/requirements.pp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
# [*log_dir*]
4545
# String. Log directory.
4646
#
47+
# [*timeout*]
48+
# The maximum time in seconds the "pip install" command should take. Default: 1800
49+
#
4750
# === Examples
4851
#
4952
# python::requirements { '/var/www/project1/requirements.txt':
@@ -70,6 +73,7 @@
7073
$extra_pip_args = '',
7174
$fix_requirements_owner = true,
7275
$log_dir = '/tmp',
76+
$timeout = 1800,
7377
) {
7478

7579
if $virtualenv == 'system' and ($owner != 'root' or $group != 'root') {
@@ -122,7 +126,7 @@
122126
provider => shell,
123127
command => "${pip_env} --log ${log}/pip.log install ${proxy_flag} ${src_flag} -r ${requirements} ${extra_pip_args}",
124128
refreshonly => !$forceupdate,
125-
timeout => 1800,
129+
timeout => $timeout,
126130
cwd => $cwd,
127131
user => $owner,
128132
subscribe => File[$requirements],

tests/requirements.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
python::requirements { '/var/www/project1/requirements.txt':
1313
virtualenv => 'system',
1414
proxy => 'http://proxy.domain.com:3128',
15+
timeout => 2400,
1516
}

0 commit comments

Comments
 (0)