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 <[email protected]>
---
 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 8b4a6bc..ec8bcc4 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 97ddd62..736f7cd 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
             }
          }, 
-- 
1.8.5.2


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to