From 8639905bb7398d5c478a387189a283b5ace4d8ec Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Tue, 28 Jan 2014 08:58:47 +0900 Subject: Make type and len class attributes of OFPInstructionMeter Make type and len class attributes of OFPInstructionMeter and update JSON accordingly. This is in keeping with the implementation of other OFPInstruction classes. Signed-off-by: Simon Horman Signed-off-by: FUJITA Tomonori --- ryu/ofproto/ofproto_v1_3_parser.py | 3 +-- ryu/tests/unit/ofproto/json/of13/4-46-ofp_flow_mod.packet.json | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ryu/ofproto/ofproto_v1_3_parser.py b/ryu/ofproto/ofproto_v1_3_parser.py index 8b4a6bc7..ec8bcc49 100644 --- a/ryu/ofproto/ofproto_v1_3_parser.py +++ b/ryu/ofproto/ofproto_v1_3_parser.py @@ -2558,9 +2558,8 @@ class OFPInstructionMeter(StringifyMixin): meter_id Meter instance ================ ====================================================== """ - _base_attributes = ['type', 'len'] - def __init__(self, meter_id): + def __init__(self, meter_id, type_=None, len_=None): super(OFPInstructionMeter, self).__init__() self.type = ofproto_v1_3.OFPIT_METER self.len = ofproto_v1_3.OFP_INSTRUCTION_METER_SIZE diff --git a/ryu/tests/unit/ofproto/json/of13/4-46-ofp_flow_mod.packet.json b/ryu/tests/unit/ofproto/json/of13/4-46-ofp_flow_mod.packet.json index 97ddd628..736f7cdd 100644 --- a/ryu/tests/unit/ofproto/json/of13/4-46-ofp_flow_mod.packet.json +++ b/ryu/tests/unit/ofproto/json/of13/4-46-ofp_flow_mod.packet.json @@ -10,6 +10,8 @@ "instructions": [ { "OFPInstructionMeter": { + "len": 8, + "type": 6, "meter_id": 1 } }, -- cgit v1.2.3