diff options
author | YAMAMOTO Takashi <yamamoto@valinux.co.jp> | 2014-03-26 13:04:17 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-04-10 07:09:56 +0900 |
commit | 5b34514c994fcb10964db350609999498f1ea90b (patch) | |
tree | e8bc5a5beb33ebe30bf791ffe9a81181109ac928 | |
parent | b75cd0c0bdaed1999c2abb9d45e40b3088ec5667 (diff) |
RyuApp: allow observing events without having handlers
this will be used by ofctl app which registers handlers dynamically.
when unobserving an event cls dynamically, there might be events of
the cls left in app's event queue already.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/base/app_manager.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ryu/base/app_manager.py b/ryu/base/app_manager.py index 821a4b5c..7d00e2e7 100644 --- a/ryu/base/app_manager.py +++ b/ryu/base/app_manager.py @@ -191,6 +191,9 @@ class RyuApp(object): return handlers def test(h): + if not ev_cls in h.callers: + # this handler does not listen the event. + return False states = h.callers[ev_cls].dispatchers if not states: # empty states means all states |