Skip to content

Commit

Permalink
Merge pull request #69 from ajoaoff/experimenter
Browse files Browse the repository at this point in the history
Fix errors in PR #68
  • Loading branch information
italovalcy authored Oct 19, 2021
2 parents 2906571 + 36522f6 commit abd4098
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions pyof/v0x04/common/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class ActionExperimenter(ActionHeader):
"""Action structure for OFPAT_EXPERIMENTER."""

experimenter = UBInt32()

_allowed_types = (ActionType.OFPAT_EXPERIMENTER,)
_allowed_ids = ()

Expand Down Expand Up @@ -187,7 +187,7 @@ def default_subclass(cls):
@classmethod
def get_subclass(cls, buff, offset):
"""Return the right subclass.
Subclasses must implement this method and decide which of
its subclasses is reponsible for this action.
"""
Expand Down Expand Up @@ -215,8 +215,8 @@ def __init__(self, length=None, experimenter=None, body=None):
body(bytes): The body of the experimenter. It is vendor-defined,
so it is left as it is.
"""
super().__init__(action_type=ActionType.OFPAT_EXPERIMENTER,
length=length, experimenter=experimenter)

super().__init__(length=length, experimenter=experimenter)
self.body = body

@classmethod
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/v0x04/test_controller2switch/test_group_mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from pyof.v0x04.controller2switch.group_mod import GroupMod
from pyof.v0x04.common.action import (
ActionExperimenter, ActionSetField, ListOfActions)
ActionExperimenterDefault, ActionSetField, ListOfActions)
from pyof.v0x04.common.flow_match import OxmClass, OxmOfbMatchField, OxmTLV
from pyof.v0x04.common.port import PortNo
from pyof.v0x04.controller2switch.common import Bucket
Expand Down Expand Up @@ -43,9 +43,9 @@ def setUp(self):

self.action1 = ActionSetField(field=self.oxmtlv1)
self.action2 = ActionSetField(field=self.oxmtlv2)
self.action3 = ActionExperimenter(length=16, experimenter=0x00002320,
self.action3 = ActionExperimenterDefault(length=16, experimenter=0x00002320,
body=b'\x00\x0e\xff\xf8\x28\x00\x00\x00')
self.action4 = ActionExperimenter(length=16, experimenter=0x00001223,
self.action4 = ActionExperimenterDefault(length=16, experimenter=0x00001223,
body=b'\x00\x0e\xff\xff\x28\x00\x00\x00')

def test_bucket_list(self):
Expand Down

0 comments on commit abd4098

Please sign in to comment.