diff options
author | Christian Breunig <christian@breunig.cc> | 2023-11-15 16:04:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-15 16:04:59 +0100 |
commit | f021386b8860a20fe774613a616799b059ab45d4 (patch) | |
tree | fbeda4ee436e965db7f3a6e798282ff0d9601581 /src/op_mode/traceroute.py | |
parent | 8c222c3848fe3b094f25d35c212784272616ad69 (diff) | |
parent | 21e4fddeebe541856e25a398018854fb0cf6fbd9 (diff) | |
download | vyos-1x-f021386b8860a20fe774613a616799b059ab45d4.tar.gz vyos-1x-f021386b8860a20fe774613a616799b059ab45d4.zip |
Merge pull request #2474 from vyos/mergify/bp/sagitta/pr-2435
mtr: T5658: Add VRF support for mtr (+ op_mode wrapper) (backport #2435)
Diffstat (limited to 'src/op_mode/traceroute.py')
-rwxr-xr-x | src/op_mode/traceroute.py | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/src/op_mode/traceroute.py b/src/op_mode/traceroute.py index 2f0edf53a..d2bac3f7c 100755 --- a/src/op_mode/traceroute.py +++ b/src/op_mode/traceroute.py @@ -14,29 +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 os import sys import socket import ipaddress -from vyos.utils.network import get_all_vrfs -from vyos.ifconfig import Section - - -def interface_list() -> list: - """ - Get list of interfaces in system - :rtype: list - """ - return Section.interfaces() - - -def vrf_list() -> list: - """ - Get list of VRFs in system - :rtype: list - """ - return list(get_all_vrfs().keys()) +from vyos.utils.network import interface_list +from vyos.utils.network import vrf_list +from vyos.utils.process import call options = { 'backward-hops': { @@ -251,6 +235,4 @@ if __name__ == '__main__': sys.exit(f'traceroute: Unknown host: {host}') command = convert(traceroute[version], args) - - # print(f'{command} {host}') - os.system(f'{command} {host}') + call(f'{command} {host}') |