should check for every system hooks, not only server_startup
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 24 Jul 2009 17:47:45 +0200
changeset 2492 c51be1cf8317
parent 2489 37a747ad6fd4
child 2493 9806571ea790
should check for every system hooks, not only server_startup
server/hooksmanager.py
--- a/server/hooksmanager.py	Fri Jul 24 15:43:11 2009 +0200
+++ b/server/hooksmanager.py	Fri Jul 24 17:47:45 2009 +0200
@@ -220,9 +220,9 @@
                '%s: events is expected to be a tuple, not %s' % (
             cls, type(cls.events))
         for event in cls.events:
-            if event == 'server_startup':
+            if event in SYSTEM_HOOKS:
                 assert not cls.accepts or cls.accepts == ('Any',), \
-                       '%s doesnt make sense on server_startup' % cls.accepts
+                       '%s doesnt make sense on %s' % (cls.accepts, event)
                 cls.accepts = ('Any',)
             for ertype in cls.accepts:
                 if (event, ertype) in done: