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>
This commit is contained in:
YAMAMOTO Takashi 2014-03-26 13:04:17 +09:00 committed by FUJITA Tomonori
parent b75cd0c0bd
commit 5b34514c99

View File

@ -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