increase ipset command timeout for cli tool

This commit is contained in:
Stefan Midjich 2017-11-16 13:49:50 +01:00
parent eddb4c0ced
commit 70c0c3049a
2 changed files with 4 additions and 2 deletions

View file

@ -4,6 +4,7 @@ import shlex
def run_ipset(command, *args, **kw):
use_sudo = kw.get('use_sudo', True)
timeout = kw.get('timeout', 2)
if use_sudo:
ipset_cmd = 'sudo ipset'
@ -19,7 +20,7 @@ def run_ipset(command, *args, **kw):
proc = subprocess.call(
shlex.split(full_command),
stdout=subprocess.PIPE,
timeout=2
timeout=timeout
)
return proc

View file

@ -103,7 +103,8 @@ if args.refresh:
config.get('ipset', 'set_name'),
'-output',
'save',
use_sudo=False
use_sudo=False,
timeout=30
)
for _line in proc.stdout.splitlines():