summaryrefslogtreecommitdiff
path: root/src/op_mode/show_vrf.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-07 08:27:36 +0200
committerGitHub <noreply@github.com>2020-04-07 08:27:36 +0200
commit09ad28b28c9ebd9308cfe9048686b3b0ef9cfd9c (patch)
tree6e7b0971ecd8859cff864b3ebb37f86f8ba288f5 /src/op_mode/show_vrf.py
parente0f13b79a669e7fc8cadac8757b2f5fbbf51dc99 (diff)
parent7256810914e6664bf92041dcd7c3daf649ce0001 (diff)
downloadvyos-1x-09ad28b28c9ebd9308cfe9048686b3b0ef9cfd9c.tar.gz
vyos-1x-09ad28b28c9ebd9308cfe9048686b3b0ef9cfd9c.zip
Merge pull request #307 from thomas-mangin/T2226
util: T2226: convert all call to use vyos.util.{popen, cmd, run}
Diffstat (limited to 'src/op_mode/show_vrf.py')
-rwxr-xr-xsrc/op_mode/show_vrf.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/op_mode/show_vrf.py b/src/op_mode/show_vrf.py
index 66c33e607..b6bb73d01 100755
--- a/src/op_mode/show_vrf.py
+++ b/src/op_mode/show_vrf.py
@@ -16,10 +16,10 @@
import argparse
import jinja2
-
-from subprocess import check_output
from json import loads
+from vyos.util import cmd
+
vrf_out_tmpl = """
VRF name state mac address flags interfaces
-------- ----- ----------- ----- ----------
@@ -31,12 +31,12 @@ VRF name state mac address flags interfa
def list_vrfs():
command = 'ip -j -br link show type vrf'
- answer = loads(check_output(command.split()).decode())
+ answer = loads(cmd(command))
return [_ for _ in answer if _]
def list_vrf_members(vrf):
command = f'ip -j -br link show master {vrf}'
- answer = loads(check_output(command.split()).decode())
+ answer = loads(cmd(command))
return [_ for _ in answer if _]
parser = argparse.ArgumentParser()