diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-11-20 07:42:15 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-11-20 07:42:15 +0100 |
commit | 94287c30406894671a89b9b75dd5a163af714e6c (patch) | |
tree | 033e60b5226c9cbc42f616a655aa16b30cf866a6 /src/op_mode | |
parent | a2cd4ae4cf5552d8ceeb29dcea265c43fc826f53 (diff) | |
download | vyos-1x-94287c30406894671a89b9b75dd5a163af714e6c.tar.gz vyos-1x-94287c30406894671a89b9b75dd5a163af714e6c.zip |
vrf: T4562: no need to invode "sudo" when retrieving VRf information
Diffstat (limited to 'src/op_mode')
-rwxr-xr-x | src/op_mode/vrf.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/op_mode/vrf.py b/src/op_mode/vrf.py index aeb50fe6e..a9a416761 100755 --- a/src/op_mode/vrf.py +++ b/src/op_mode/vrf.py @@ -31,14 +31,14 @@ def _get_raw_data(name=None): If vrf name is set - get only this name data If vrf name set and not found - return [] """ - output = cmd('sudo ip --json --brief link show type vrf') + output = cmd('ip --json --brief link show type vrf') data = json.loads(output) if not data: return [] if name: is_vrf_exists = True if [vrf for vrf in data if vrf.get('ifname') == name] else False if is_vrf_exists: - output = cmd(f'sudo ip --json --brief link show dev {name}') + output = cmd(f'ip --json --brief link show dev {name}') data = json.loads(output) return data return [] @@ -51,7 +51,7 @@ def _get_vrf_members(vrf: str) -> list: :param vrf: str :return: list """ - output = cmd(f'sudo ip --json --brief link show master {vrf}') + output = cmd(f'ip --json --brief link show master {vrf}') answer = json.loads(output) interfaces = [] for data in answer: |