bgp: fix bug of labels formatting for show VPNv4 prefix information

The field of 'Labels' has not displayed in properly because of extracting 'label_list' in python slicing tuples.

INFO:bgpspeaker.api.base:API method operator.show called with args: {'params': ['rib', 'all'], 'format': 'cli'}
Status codes: * valid, > best
    Network                          Labels   Next Hop             Reason          Metric LocPrf Path/Origin
Family: rtfilter
*>  64512:64511:101                  None     0.0.0.0              Only Path                     2
Family: vpnv6
Family: vpnv4
*>  64511:101:10.10.0.1/32           ([17],)  192.168.100.100      Only Path       0             64511 2
*>  64511:101:10.20.2.0/24           ([100],) 0.0.0.0              Only Path                     2
*>  64511:101:10.20.1.0/24           ([100],) 0.0.0.0              Only Path                     2
*>  64511:101:10.20.3.0/24           ([100],) 0.0.0.0              Only Path                     2
Family: ipv4
Family: ipv6

Reported-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
FUJITA Tomonori 2014-08-13 13:56:21 +09:00
parent c4abf05e9e
commit c451b6e4ec

View File

@ -932,7 +932,7 @@ class LabelledVPNIPAddrPrefix(_LabelledAddrPrefix, _VPNAddrPrefix,
@property
def label_list(self):
return self.addr[:-2]
return self.addr[0]
@property
def formatted_nlri_str(self):
@ -955,7 +955,7 @@ class LabelledVPNIP6AddrPrefix(_LabelledAddrPrefix, _VPNAddrPrefix,
@property
def label_list(self):
return self.addr[:-2]
return self.addr[0]
@property
def formatted_nlri_str(self):