summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Mangin <thomas.mangin@exa.net.uk>2020-04-05 16:31:15 +0100
committerThomas Mangin <thomas.mangin@exa.net.uk>2020-04-06 20:22:35 +0100
commitb964713c491fcf7d5a3323d1d187415c5b650940 (patch)
treefac993fae103a86cde4a3d46d95bc62e211c178d /src
parent7219d4013814a55c4eeaf36b7a36d5e8076d09f0 (diff)
downloadvyos-1x-b964713c491fcf7d5a3323d1d187415c5b650940.tar.gz
vyos-1x-b964713c491fcf7d5a3323d1d187415c5b650940.zip
util: T2226: rewrite list_dumpable_interfaces to use cmd
Diffstat (limited to 'src')
-rwxr-xr-xsrc/completion/list_dumpable_interfaces.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/completion/list_dumpable_interfaces.py b/src/completion/list_dumpable_interfaces.py
index 53ee89633..101c92fbe 100755
--- a/src/completion/list_dumpable_interfaces.py
+++ b/src/completion/list_dumpable_interfaces.py
@@ -3,12 +3,10 @@
# Extract the list of interfaces available for traffic dumps from tcpdump -D
import re
-import subprocess
-if __name__ == '__main__':
- out = subprocess.check_output(['/usr/sbin/tcpdump', '-D']).decode().strip()
- out = out.split("\n")
+from vyos.util import cmd
+if __name__ == '__main__':
+ out = cmd('/usr/sbin/tcpdump -D').split('\n')
intfs = " ".join(map(lambda s: re.search(r'\d+\.(\S+)\s', s).group(1), out))
-
print(intfs)