diff options
author | YAMAMOTO Takashi <yamamoto@valinux.co.jp> | 2014-06-16 19:18:53 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-06-17 06:50:41 +0900 |
commit | 4f19fc54cd671d594a685abf7ab44e8c09d4956d (patch) | |
tree | a422779682c089b3394902f05b393a9ce08cf7c6 | |
parent | ba9621627de2691eeb6edae486c25c2f0b635f39 (diff) |
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>
-rw-r--r-- | ryu/base/app_manager.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ryu/base/app_manager.py b/ryu/base/app_manager.py index d433c59a..695c401e 100644 --- a/ryu/base/app_manager.py +++ b/ryu/base/app_manager.py @@ -226,9 +226,10 @@ class RyuApp(object): return handlers def test(h): - if ev_cls not in h.callers: - # this handler does not listen the event. - return False + if not hasattr(h, 'callers') or ev_cls not in h.callers: + # dynamically registered handlers does not have + # h.callers element for the event. + return True states = h.callers[ev_cls].dispatchers if not states: # empty states means all states |