diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-11-10 19:13:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-10 19:13:23 +0100 |
commit | 4b3ab8de85618a96b89ffa84094f49b1fca06e0c (patch) | |
tree | 6b6194186d7987e61078c84edf518de838c1a0b8 /src | |
parent | 991d92e60c5087a0e00cc7dccc144f62927ddd4e (diff) | |
parent | a34d189f3218199e329892b3ce88b367337a6de8 (diff) | |
download | vyos-1x-4b3ab8de85618a96b89ffa84094f49b1fca06e0c.tar.gz vyos-1x-4b3ab8de85618a96b89ffa84094f49b1fca06e0c.zip |
Merge pull request #1652 from aapostoliuk/T4496-sagitta
T4496: Refactoring vrf_list function in ping command
Diffstat (limited to 'src')
-rwxr-xr-x | src/op_mode/ping.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/op_mode/ping.py b/src/op_mode/ping.py index 5e5b95a0a..610e63cb3 100755 --- a/src/op_mode/ping.py +++ b/src/op_mode/ping.py @@ -18,8 +18,7 @@ import os import sys import socket import ipaddress -import json -from vyos.util import cmd, rc_cmd +from vyos.util import get_all_vrfs from vyos.ifconfig import Section @@ -36,13 +35,7 @@ def vrf_list() -> list: Get list of VRFs in system :rtype: list """ - result = cmd(f'sudo ip --json --brief link show type vrf') - data = json.loads(result) - vrflist: list = [] - for o in data: - if 'ifname' in o: - vrflist.append(o['ifname']) - return vrflist + return list(get_all_vrfs().keys()) options = { |