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)
)
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

View file

@ -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():