subprocess.run does not work in python 3.4

This commit is contained in:
Stefan Midjich 2017-11-16 13:46:30 +01:00
parent 6f476223b5
commit eddb4c0ced
2 changed files with 4 additions and 11 deletions

View file

@ -16,18 +16,10 @@ def run_ipset(command, *args, **kw):
args=' '.join(args) args=' '.join(args)
) )
proc = subprocess.run( proc = subprocess.call(
shlex.split(full_command), shlex.split(full_command),
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
timeout=2, timeout=2
check=True
) )
#proc = subprocess.Popen(
# shlex.split(full_command),
# stdout=subprocess.PIPE
#)
#(output, error) = proc.communicate(timeout=2)
return proc return proc

View file

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