Univention Bugzilla – Bug 27376
Listener: Exception wird falschem Modul zugeordnet
Last modified: 2012-12-12 21:11:08 CET
Beim Schreiben eines Listener-Moduls wurde plötzlich im 'pkgdb-watch'-Listener ein Fehler gemeldet, obwohl der völlig korrekt war. Eigentlicher Verursacher war aber das vorhergehende Modul, in diesem Fall das neue Modul: > LISTENER (INFO ) importing handler /usr/lib/univention-directory-listener/system/multi-master-push.py > LISTENER (INFO ) Load file /usr/lib/univention-directory-listener/system/multi-master-push.py > LISTENER (ALL ) Parse file /usr/lib/univention-directory-listener/system/multi-master-push.py > LISTENER (ALL ) pyNode compile /usr/lib/univention-directory-listener/system/multi-master-push.py > LISTENER (ALL ) execCodeModuleEx /usr/lib/univention-directory-listener/system/multi-master-push.py > LISTENER (ALL ) mmp.init() > LISTENER (ALL ) Module done /usr/lib/univention-directory-listener/system/multi-master-push.py Hier müsste jetzt eigentlichd die Fehlermeldung stehen, > LISTENER (INFO ) importing handler /usr/lib/univention-directory-listener/system/pkgdb-watch.py > LISTENER (INFO ) Load file /usr/lib/univention-directory-listener/system/pkgdb-watch.py > LISTENER (ALL ) Parse file /usr/lib/univention-directory-listener/system/pkgdb-watch.py > LISTENER (ALL ) pyNode compile /usr/lib/univention-directory-listener/system/pkgdb-watch.py > LISTENER (ERROR) import of filename=/usr/lib/univention-directory-listener/system/pkgdb-watch.py failed > AttributeError: 'module' object has no attribute 'filter' sie kommt aber erst hier. > LISTENER (ERROR) import of filename=/usr/lib/univention-directory-listener/system/pkgdb-watch.py failed > TypeError: argument must be string, not bool Nach ein paar Anpassungen am eigenen mmp-Modul hatte ich dann diese Meldung. Hier sollte die Fehlerbehandlung in handler_import() in src/handlers.c:191 überprüft und korrigietr werden.
Created attachment 4422 [details] Error handling when loading modules Der Patch hat mit jetzt erlaubt zu erkennen, das "modrdn" eine Zeichenkette sein muß (und kein bool'scher Wert sein darf) Neben der Fehlerbehandlung der Python-Fehler korrigiert der Patch auch Speicherlecks im Fehlerfall.
Patch wurde übernommen. svn35237, univention-directory-listener_7.0.1-1.156.201209051131 ChangeLog: svn14594 \item The reporting of errors in Python Listener modules has been improved (\ucsBug{27376}).
Im Fehlerfall sind die Hinweise jetzt deutlich ausführlicher und das passende Modul wird angegeben. Changelog: OK.
UCS 3.1-0 has been released: http://forum.univention.de/viewtopic.php?f=54&t=2125 If this error occurs again, please use "Clone This Bug".