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

EventDP not triggering #19

Closed
reitblatt opened this issue Jan 22, 2014 · 3 comments
Closed

EventDP not triggering #19

reitblatt opened this issue Jan 22, 2014 · 3 comments

Comments

@reitblatt
Copy link

If I catch dpset.EventDP, my function is never called. If I change it to ofp_event.EventOFPStateChange, it works.

Doesn't work:

from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller import dpset
from ryu.controller.handler import MAIN_DISPATCHER
from ryu.controller.handler import set_ev_cls

class Example(app_manager.RyuApp):
    def __init__(self, *args, **kwargs):
        super(Example, self).__init__(*args, **kwargs)

    @set_ev_cls(dpset.EventDP, MAIN_DISPATCHER)
    def switch_up_handler(self, ev):
        print "DP  Up!"

Works:

from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller import dpset
from ryu.controller.handler import MAIN_DISPATCHER
from ryu.controller.handler import set_ev_cls

class Example(app_manager.RyuApp):
    def __init__(self, *args, **kwargs):
        super(Example, self).__init__(*args, **kwargs)

    @set_ev_cls(ofp_event.EventOFPStateChange, MAIN_DISPATCHER)
    def switch_up_handler(self, ev):
        print "DP  Up!"

P.S. If I named the file "test.py" ryu-manager seemed to just ignore it.

@fujita
Copy link
Contributor

fujita commented Jan 23, 2014

Thanks for the report. I posted a fix for this to the mailing list. Please use the mailing list instead.

@fujita fujita closed this as completed Jan 23, 2014
@reitblatt
Copy link
Author

Sorry about that. You know that you can disable issues on github by going to https://github.com/osrg/ryu/settings and unchecking the "Issues" box under Features?

@fujita
Copy link
Contributor

fujita commented Jan 24, 2014

Ah, Thanks. I didn't know and disabled. I merged the fix so please try the latest git head to check if it works. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants