summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-11-20 07:42:15 +0100
committerChristian Poessinger <christian@poessinger.com>2022-11-20 07:42:15 +0100
commit94287c30406894671a89b9b75dd5a163af714e6c (patch)
tree033e60b5226c9cbc42f616a655aa16b30cf866a6 /src
parenta2cd4ae4cf5552d8ceeb29dcea265c43fc826f53 (diff)
downloadvyos-1x-94287c30406894671a89b9b75dd5a163af714e6c.tar.gz
vyos-1x-94287c30406894671a89b9b75dd5a163af714e6c.zip
vrf: T4562: no need to invode "sudo" when retrieving VRf information
Diffstat (limited to 'src')
-rwxr-xr-xsrc/op_mode/vrf.py6
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: