Fix OFPQueuePropMinRate class

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

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
FUJITA Tomonori 2012-05-18 12:58:09 +09:00
parent e817357a3b
commit 7df808edec

View File

@ -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)