- __str__ method: needs to pass a tuple to msg_str_attr
- parser method: rate shouldn't be a tuple.

Signed-off-by: FUJITA Tomonori <[email protected]>
---
 ryu/ofproto/ofproto_v1_0_parser.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/ryu/ofproto/ofproto_v1_0_parser.py 
b/ryu/ofproto/ofproto_v1_0_parser.py
index 0ac5abc..dd1bebf 100644
--- a/ryu/ofproto/ofproto_v1_0_parser.py
+++ b/ryu/ofproto/ofproto_v1_0_parser.py
@@ -841,12 +841,13 @@ class OFPQueuePropMinRate(OFPQueuePropHeader):
 
     def __str__(self):
         buf = super(OFPQueuePropMinRate, self).__str__()
-        return msg_str_attr(self, buf, ('rate'))
+        return msg_str_attr(self, buf, ('rate',))
 
     @classmethod
     def parser(cls, buf, offset):
-        rate = struct.pack_from(ofproto_v1_0.OFP_QUEUE_PROP_MIN_RATE_PACK_STR,
-                                buf, offset)
+        (rate,) = struct.unpack_from(
+            ofproto_v1_0.OFP_QUEUE_PROP_MIN_RATE_PACK_STR,
+            buf, offset)
         return cls(rate)
 
 
-- 
1.7.4.4


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to