summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Mangin <thomas.mangin@exa.net.uk>2020-04-05 18:21:44 +0100
committerThomas Mangin <thomas.mangin@exa.net.uk>2020-04-06 20:22:35 +0100
commit9fabc8caec5a39e10fbbe20325d268ccacf1e0a9 (patch)
treed77944431790ea54da8a59dc3b4c75acc6b157be
parent0dfe1c13f257f1d3428f53e7e7078b7e3f5088b6 (diff)
downloadvyos-1x-9fabc8caec5a39e10fbbe20325d268ccacf1e0a9.tar.gz
vyos-1x-9fabc8caec5a39e10fbbe20325d268ccacf1e0a9.zip
util: T2226: rewrite show vrf to use cmd
-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()