bgp: Prevent __str__() methods from raising exceptions

bgp.BadMsg.__str__(): avoid "AttributeError: 'BadMsg' object has no attribute 'msg'"

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
Akihiro Suda 2015-02-25 22:56:23 +09:00 committed by FUJITA Tomonori
parent d1ff39ebab
commit 665be6e276

View File

@ -276,7 +276,7 @@ class BadMsg(BgpExc):
self.data = struct.pack('B', msg_type)
def __str__(self):
return '<BadMsg %d>' % (self.msg,)
return '<BadMsg %d>' % (self.msg_type,)
# ============================================================================
# OPEN Message Errors