From 5e61b09a5d0ad4d4cfd25eafcc95f0d2b1a927b9 Mon Sep 17 00:00:00 2001 From: DmitriyEshenko Date: Fri, 10 Apr 2020 18:16:15 +0000 Subject: pptp: l2tp: T2262: Fix call to function run() --- src/op_mode/reset_vpn.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/op_mode/reset_vpn.py b/src/op_mode/reset_vpn.py index 8962df212..15908ee77 100755 --- a/src/op_mode/reset_vpn.py +++ b/src/op_mode/reset_vpn.py @@ -30,41 +30,40 @@ def terminate_sessions(username='', interface='', protocol=''): if username == "all_users": if protocol == "pptp": pptp_cmd = pptp_base.format('all','') - run(pptp_cmd, stdout=DEVNULL, stderr=DEVNULL) + run(pptp_cmd) return elif protocol == "l2tp": l2tp_cmd = l2tp_base.format('all', '') - run(l2tp_cmd, stdout=DEVNULL, stderr=DEVNULL) + run(l2tp_cmd) return else: pptp_cmd = pptp_base.format('all', '') - run(pptp_cmd, stdout=DEVNULL, stderr=DEVNULL) + run(pptp_cmd) l2tp_cmd = l2tp_base.format('all', '') - run(l2tp_cmd, stdout=DEVNULL, stderr=DEVNULL) + run(l2tp_cmd) return if protocol == "pptp": pptp_cmd = pptp_base.format('username', username) - run(pptp_cmd, stdout=DEVNULL, stderr=DEVNULL) + run(pptp_cmd) return elif protocol == "l2tp": l2tp_cmd = l2tp_base.format('username', username) - run(l2tp_cmd, stdout=DEVNULL, stderr=DEVNULL) + run(l2tp_cmd) return else: pptp_cmd = pptp_base.format('username', username) - run(pptp_cmd, stdout=DEVNULL, stderr=DEVNULL) - l2tp_cmd.append("terminate username {0}".format(username)) - run(l2tp_cmd, stdout=DEVNULL, stderr=DEVNULL) + run(pptp_cmd) + l2tp_cmd = l2tp_base.format('username', username) + run(l2tp_cmd) return # rewrite `terminate by interface` if pptp will have pptp%d interface naming if interface: pptp_cmd = pptp_base.format('if', interface) - run(pptp_cmd, stdout=DEVNULL, stderr=DEVNULL) + run(pptp_cmd) l2tp_cmd = l2tp_base.format('if', interface) - run(l2tp_cmd, stdout=DEVNULL, stderr=DEVNULL) - + run(l2tp_cmd) def main(): #parese args -- cgit v1.2.3