diff options
author | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-04-05 17:53:46 +0100 |
---|---|---|
committer | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-04-06 20:22:35 +0100 |
commit | 153f7c17b5743ea3b7d91200f503126e711b46ba (patch) | |
tree | 16d196e0dbf3e86cd5243492d34150a74b205de1 /src/op_mode/clear_conntrack.py | |
parent | c90aca4f9a25af4b0660dbf6fbeafae68439d4ab (diff) | |
download | vyos-1x-153f7c17b5743ea3b7d91200f503126e711b46ba.tar.gz vyos-1x-153f7c17b5743ea3b7d91200f503126e711b46ba.zip |
util: T2226: rewrite clear conntrack to use cmd
Diffstat (limited to 'src/op_mode/clear_conntrack.py')
-rwxr-xr-x | src/op_mode/clear_conntrack.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/op_mode/clear_conntrack.py b/src/op_mode/clear_conntrack.py index 0e52b9086..423694187 100755 --- a/src/op_mode/clear_conntrack.py +++ b/src/op_mode/clear_conntrack.py @@ -14,13 +14,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -import subprocess import sys from vyos.util import ask_yes_no +from vyos.util import cmd, DEVNULL if not ask_yes_no("This will clear all currently tracked and expected connections. Continue?"): sys.exit(1) else: - subprocess.check_call(['/usr/sbin/conntrack -F'], shell=True, stderr=subprocess.DEVNULL) - subprocess.check_call(['/usr/sbin/conntrack -F expect'], shell=True, stderr=subprocess.DEVNULL) + cmd('/usr/sbin/conntrack -F', stderr=DEVNULL) + cmd('/usr/sbin/conntrack -F expect', stderr=DEVNULL) |