From 5b34514c994fcb10964db350609999498f1ea90b Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 26 Mar 2014 13:04:17 +0900 Subject: [PATCH] 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 Signed-off-by: FUJITA Tomonori --- ryu/base/app_manager.py | 3 +++ 1 file changed, 3 insertions(+) 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