summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Mangin <thomas.mangin@exa.net.uk>2020-04-05 17:53:46 +0100
committerThomas Mangin <thomas.mangin@exa.net.uk>2020-04-06 20:22:35 +0100
commit153f7c17b5743ea3b7d91200f503126e711b46ba (patch)
tree16d196e0dbf3e86cd5243492d34150a74b205de1 /src
parentc90aca4f9a25af4b0660dbf6fbeafae68439d4ab (diff)
downloadvyos-1x-153f7c17b5743ea3b7d91200f503126e711b46ba.tar.gz
vyos-1x-153f7c17b5743ea3b7d91200f503126e711b46ba.zip
util: T2226: rewrite clear conntrack to use cmd
Diffstat (limited to 'src')
-rwxr-xr-xsrc/op_mode/clear_conntrack.py6
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)