From eddb4c0cedc13b885c598d114a906a74616fad7e Mon Sep 17 00:00:00 2001 From: Stefan Midjich Date: Thu, 16 Nov 2017 13:46:30 +0100 Subject: [PATCH] subprocess.run does not work in python 3.4 --- tools/helpers.py | 12 ++---------- tools/manage_client.py | 3 ++- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/tools/helpers.py b/tools/helpers.py index 7eaaebb..f05bc84 100644 --- a/tools/helpers.py +++ b/tools/helpers.py @@ -16,18 +16,10 @@ def run_ipset(command, *args, **kw): args=' '.join(args) ) - proc = subprocess.run( + proc = subprocess.call( shlex.split(full_command), stdout=subprocess.PIPE, - timeout=2, - check=True + timeout=2 ) - #proc = subprocess.Popen( - # shlex.split(full_command), - # stdout=subprocess.PIPE - #) - - #(output, error) = proc.communicate(timeout=2) - return proc \ No newline at end of file diff --git a/tools/manage_client.py b/tools/manage_client.py index 5a1abc8..89da3b6 100644 --- a/tools/manage_client.py +++ b/tools/manage_client.py @@ -102,7 +102,8 @@ if args.refresh: 'list', config.get('ipset', 'set_name'), '-output', - 'save' + 'save', + use_sudo=False ) for _line in proc.stdout.splitlines():