Univention Bugzilla – Bug 50301
remove_*_rejected should have a --all parameter
Last modified: 2020-05-27 16:40:37 CEST
Created attachment 10194 [details] patch (git:fbest/50301-remove-all-rejected) I have a lot of rejects (due to ucs-test) which are spamming the connector. remove_*_rejected.py should have a --all argument. Attached is a patch which does this.
IMHO we should not add such an option to that tool, because it suggests that this is something that we support. We should put our energy into avoiding the causes of rejects instead. If we need this for ucs-test then we should write a script for ucs-test which does this. It's not complicated.
OK: I don't really need it in the product. python: import sqlite3, os cache_db = sqlite3.connect('/etc/univention/connector/s4internal.sqlite') c = cache_db.cursor() c.execute("DELETE FROM 'S4 rejected'") cache_db.commit() c = cache_db.cursor() c.execute("SELECT key FROM 'UCS rejected'") filenames = c.fetchall() for filename in filenames: if filename: if os.path.exists(filename[0]): os.remove(filename[0]) c.execute("DELETE FROM 'UCS rejected'") cache_db.commit() cache_db.close()