mirror of
https://codeberg.org/prof_x_pvt_ltd/captive.whump.shanti-portal
synced 2024-08-14 22:46:42 +00:00
subprocess.run does not work in python 3.4
This commit is contained in:
parent
6f476223b5
commit
eddb4c0ced
2 changed files with 4 additions and 11 deletions
|
@ -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
|
|
@ -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():
|
||||||
|
|
Loading…
Reference in a new issue