app_manager: Stop checking h.callers in get_handlers()
dynamically registered handlers (vs. ones registered via set_ev_cls/handler decorators) do not necessarily have h.callers. 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:
parent
ba9621627d
commit
4f19fc54cd
@ -226,9 +226,10 @@ class RyuApp(object):
|
|||||||
return handlers
|
return handlers
|
||||||
|
|
||||||
def test(h):
|
def test(h):
|
||||||
if ev_cls not in h.callers:
|
if not hasattr(h, 'callers') or ev_cls not in h.callers:
|
||||||
# this handler does not listen the event.
|
# dynamically registered handlers does not have
|
||||||
return False
|
# h.callers element for the event.
|
||||||
|
return True
|
||||||
states = h.callers[ev_cls].dispatchers
|
states = h.callers[ev_cls].dispatchers
|
||||||
if not states:
|
if not states:
|
||||||
# empty states means all states
|
# empty states means all states
|
||||||
|
Loading…
x
Reference in New Issue
Block a user