Univention Bugzilla – Bug 51941
import hook that logs attributes of user before/after changes
Last modified: 2020-10-12 16:19:01 CEST
Create an import hook that runs before and/or after create/modify/move/delete operations and writes a configurable number of attributes of a user to the log file.
The intention is to facilitate easier debugging in cases where users attributes seem to be changed in unexpected ways.
The hook "log_user_object.py" has been added to /usr/share/ucs-school-import/pyhooks-available in git branch dtroeder/51941_log_user_hook
[7d4099d71] Bug #51941: add import hook to log user state before and/or after create/modify/move/delete operations
Please reopen for merge and build, when QAing.
QA -> All Ok, but first read QA -> REOPEN for merge & build
Code- > looks good
PROPS are logged as expected -> OK
If prop is neither in user._attributes nor in udm_obj, I get a KeyError. I think this is Ok, but I would prefer an error logging like "Property %s does not exist for user".
when creating a user log_user_attrs gets called
- in post_create as last hook
when modifying a user log_user_attrs gets called
- in pre_modify as first hook
- post_modify as last hook
when deleting a user log_user_attrs gets called
- in pre_remove as first hook
when moving a user log_user_attrs gets called
- in pre_move as first hook
- in post_move as first hook
(tested with sisopi, afterwards pre & post_modify are called as well.)
I squashed the fixup commits, merged and built:
[8575a55b9] Bug #51941: add import hook to log user state before and/or after create/modify/move/delete operations
[79544c1a9] Bug #51941: Merge branch 'dtroeder/51941_log_user_hook' into 4.4
[bc6bf404e] Bug #51941: changelog
[23664516a] Bug #51941: advisory
Thanks for the quick response!
QA -> All OK
Changelog -> OK
YAML -> OK
no merge conflicts -> OK
set to VERIFIED
UCS@school 4.4 v7 has been released.
If this error occurs again, please clone this bug.