mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-05 20:36:10 +02:00
ofproto_parser: simplify msg_str_attr() a bit
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
ed06fbd397
commit
0fb2bbae4f
@ -150,10 +150,7 @@ def msg_pack_into(fmt, buf, offset, *args):
|
||||
def msg_str_attr(msg, buf, attr_list=None):
|
||||
if attr_list is None:
|
||||
exclude = ['_attributes']
|
||||
try:
|
||||
exclude += msg._attributes
|
||||
except AttributeError:
|
||||
pass
|
||||
exclude += getattr(msg, '_attributes', [])
|
||||
attr_list = set(dir(msg)) - set(exclude)
|
||||
for attr in attr_list:
|
||||
val = getattr(msg, attr, None)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user