Bug 50301 - remove_*_rejected should have a --all parameter
remove_*_rejected should have a --all parameter
Status: RESOLVED INVALID
Product: UCS
Classification: Unclassified
Component: S4 Connector
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: Samba maintainers
Samba maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-10-02 11:35 CEST by Florian Best
Modified: 2020-05-27 16:40 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
patch (git:fbest/50301-remove-all-rejected) (2.23 KB, patch)
2019-10-02 11:35 CEST, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2019-10-02 11:35:07 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.
Comment 1 Arvid Requate univentionstaff 2019-10-07 19:19:37 CEST
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.
Comment 2 Florian Best univentionstaff 2020-05-27 16:40:37 CEST
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()