diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-06 21:01:31 -0800 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-06 21:01:31 -0800 |
commit | bdbb80e9a6eb2928f4942b432dba0fb0595fc658 (patch) | |
tree | 0b4873aa89db7b565944283e9930afd5fe17cb40 /cli/gobgpcli | |
parent | 3371547e00ded7a9c329ccf84827a55dd7d7d084 (diff) |
table: fix rib presentation
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'cli/gobgpcli')
-rwxr-xr-x | cli/gobgpcli | 8 |
1 files changed, 3 insertions, 5 deletions
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 |