From 70c0c3049a4114e8a4d9a987022f6f8e9a3e59c5 Mon Sep 17 00:00:00 2001 From: Stefan Midjich Date: Thu, 16 Nov 2017 13:49:50 +0100 Subject: [PATCH] increase ipset command timeout for cli tool --- tools/helpers.py | 3 ++- tools/manage_client.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/helpers.py b/tools/helpers.py index f05bc84..ace947e 100644 --- a/tools/helpers.py +++ b/tools/helpers.py @@ -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 \ No newline at end of file diff --git a/tools/manage_client.py b/tools/manage_client.py index 89da3b6..019b52d 100644 --- a/tools/manage_client.py +++ b/tools/manage_client.py @@ -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():