View | Details | Raw Unified | Return to bug 50301
Collapse All | Expand All

(-)a/services/univention-s4-connector/scripts/remove_s4_rejected.py (+14 lines)
 Lines 52-61   def remove_s4_rejected(s4_dn): Link Here 
52
	cache_db.close()
52
	cache_db.close()
53
53
54
54
55
def remove_all_s4_rejects():
56
	cache_db = sqlite3.connect('/etc/univention/connector/s4internal.sqlite')
57
	c = cache_db.cursor()
58
	c.execute("DELETE FROM 'S4 rejected'")
59
	cache_db.commit()
60
	cache_db.close()
61
62
55
if __name__ == '__main__':
63
if __name__ == '__main__':
56
	parser = OptionParser(usage='remove_s4_rejected.py dn')
64
	parser = OptionParser(usage='remove_s4_rejected.py dn')
65
	parser.add_option('--all', action='store_true')
57
	(options, args) = parser.parse_args()
66
	(options, args) = parser.parse_args()
58
67
68
	if options.all:
69
		remove_all_s4_rejects()
70
		print('The rejected S4 objects have been removed.')
71
		sys.exit(0)
72
59
	if len(args) != 1:
73
	if len(args) != 1:
60
		parser.print_help()
74
		parser.print_help()
61
		sys.exit(2)
75
		sys.exit(2)
(-)a/services/univention-s4-connector/scripts/remove_ucs_rejected.py (+20 lines)
 Lines 57-66   def remove_ucs_rejected(ucs_dn): Link Here 
57
	cache_db.close()
57
	cache_db.close()
58
58
59
59
60
def remove_all_ucs_rejected():
61
	cache_db = sqlite3.connect('/etc/univention/connector/s4internal.sqlite')
62
	c = cache_db.cursor()
63
	c.execute("SELECT key FROM 'UCS rejected'")
64
	filenames = c.fetchall()
65
	for filename in filenames:
66
		if filename:
67
			if os.path.exists(filename[0]):
68
				os.remove(filename[0])
69
	c.execute("DELETE FROM 'UCS rejected'")
70
	cache_db.commit()
71
	cache_db.close()
72
73
60
if __name__ == '__main__':
74
if __name__ == '__main__':
61
	parser = OptionParser(usage='remove_ucs_rejected.py dn')
75
	parser = OptionParser(usage='remove_ucs_rejected.py dn')
76
	parser.add_option('--all', action='store_true')
62
	(options, args) = parser.parse_args()
77
	(options, args) = parser.parse_args()
63
78
79
	if options.all:
80
		print('The rejected UCS objects have been removed.')
81
		remove_all_ucs_rejected()
82
		sys.exit(0)
83
64
	if len(args) != 1:
84
	if len(args) != 1:
65
		parser.print_help()
85
		parser.print_help()
66
		sys.exit(2)
86
		sys.exit(2)

Return to bug 50301