summaryrefslogtreecommitdiff
path: root/src/op_mode/traceroute.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-11-12 10:10:52 +0100
committerGitHub <noreply@github.com>2023-11-12 10:10:52 +0100
commit45ac050b914d8fbbc64f3492ec7aed80d710643c (patch)
tree129ce4d073d74f053c2a810bd23e97f9c34c6f91 /src/op_mode/traceroute.py
parente5a53d48cf149facb30410c25e55ab3780205186 (diff)
parentc0de93d37354ec89f44dde7f1b5a4c8af550a019 (diff)
downloadvyos-1x-45ac050b914d8fbbc64f3492ec7aed80d710643c.tar.gz
vyos-1x-45ac050b914d8fbbc64f3492ec7aed80d710643c.zip
Merge pull request #2435 from bbabich/current
mtr: T5658: Add VRF support for mtr (+ op_mode wrapper)
Diffstat (limited to 'src/op_mode/traceroute.py')
-rwxr-xr-xsrc/op_mode/traceroute.py26
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}')