From bdbb80e9a6eb2928f4942b432dba0fb0595fc658 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Tue, 6 Jan 2015 21:01:31 -0800 Subject: table: fix rib presentation Signed-off-by: FUJITA Tomonori --- cli/gobgpcli | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'cli/gobgpcli') diff --git a/cli/gobgpcli b/cli/gobgpcli index f1209bb3..70e70e78 100755 --- a/cli/gobgpcli +++ b/cli/gobgpcli @@ -164,22 +164,20 @@ class Show(object): if self.options.debug: print r.json() return 0 - print(" Network Next Hop AS Attrs") + print(" Network Next Hop AS_PATH Attrs") for d in r.json()["Destinations"]: for p in d["Paths"]: nexthop = "" AS = "" for a in p["Attrs"]: - if a["Type"] == "BGP_ATTR_TYPE_NEXT_HOP": - nexthop = a["Nexthop"] - elif a["Type"] == "BGP_ATTR_TYPE_AS_PATH": + if a["Type"] == "BGP_ATTR_TYPE_AS_PATH": AS = a["AsPath"] if p["Best"] == "true": header = "*>" else: header = "*" print("{:s} {:s} {:s} {:s} {:s}".format(header, p["Network"], - nexthop, AS, self._format_attrs(p["Attrs"]))) + p["Nexthop"], AS, self._format_attrs(p["Attrs"]))) return 0 -- cgit v1.2.3