Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

of_json: pass type of action to the underlying ofp_action_-classes #159

Open
wants to merge 2 commits into
base: eel
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions pox/openflow/of_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,18 @@ def dict_to_action (d):
d['port'] = _fix_of_int(d['port'])

t = d['type'].upper()
del d['type']

if not t.startswith("OFPAT_"): t = "OFPAT_" + t
t = of.ofp_action_type_rev_map[t]
cls = of._action_type_to_class[t]
a = cls(**d)
d['type'] = t

try:
a = cls(**d)
except TypeError:
del d['type']
a = cls(**d)

return a


Expand Down