diff --git a/ryu/controller/ofp_event.py b/ryu/controller/ofp_event.py index 2175e50a..43e7113b 100644 --- a/ryu/controller/ofp_event.py +++ b/ryu/controller/ofp_event.py @@ -40,8 +40,12 @@ def _ofp_msg_name_to_ev_name(msg_name): def ofp_msg_to_ev(msg): - name = _ofp_msg_name_to_ev_name(msg.__class__.__name__) - return _OFP_MSG_EVENTS[name](msg) + return ofp_msg_to_ev_cls(msg.__class__)(msg) + + +def ofp_msg_to_ev_cls(msg_cls): + name = _ofp_msg_name_to_ev_name(msg_cls.__name__) + return _OFP_MSG_EVENTS[name] def _create_ofp_msg_ev_class(msg_cls):