diff options
author | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-04-05 16:31:15 +0100 |
---|---|---|
committer | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-04-06 20:22:35 +0100 |
commit | b964713c491fcf7d5a3323d1d187415c5b650940 (patch) | |
tree | fac993fae103a86cde4a3d46d95bc62e211c178d /src/completion/list_dumpable_interfaces.py | |
parent | 7219d4013814a55c4eeaf36b7a36d5e8076d09f0 (diff) | |
download | vyos-1x-b964713c491fcf7d5a3323d1d187415c5b650940.tar.gz vyos-1x-b964713c491fcf7d5a3323d1d187415c5b650940.zip |
util: T2226: rewrite list_dumpable_interfaces to use cmd
Diffstat (limited to 'src/completion/list_dumpable_interfaces.py')
-rwxr-xr-x | src/completion/list_dumpable_interfaces.py | 8 |
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) |