summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2013-05-13 12:03:25 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2013-05-14 00:43:11 +0900
commit0fb2bbae4f9cc512b824af73dac079720d6ff285 (patch)
tree78f88e9f28ffd473df64935f52374d7a2260b3cf
parented06fbd39777f01a443b1c28922817b22be6b523 (diff)
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>
-rw-r--r--ryu/ofproto/ofproto_parser.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/ryu/ofproto/ofproto_parser.py b/ryu/ofproto/ofproto_parser.py
index 5b4cf24c..5d170ca8 100644
--- a/ryu/ofproto/ofproto_parser.py
+++ b/ryu/ofproto/ofproto_parser.py
@@ -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)