mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Improve some error handling in ipa-replica-manage
If you break a replica install after the agreement is created but before it gets much further you'll be in the situation where an agreement exists, no cn=masters entry exists, and the RUV may not be set yet. This adds some error handling so the broken install can be safely removed. https://fedorahosted.org/freeipa/ticket/3444
This commit is contained in:
parent
66356f0daf
commit
c8846bab25
@ -654,8 +654,11 @@ def del_master(realm, hostname, options):
|
||||
|
||||
for master_cn in [m.single_value('cn') for m in masters]:
|
||||
master_dn = DN(('cn', master_cn), ('cn', 'masters'), ('cn', 'ipa'), ('cn', 'etc'), ipautil.realm_to_suffix(realm))
|
||||
try:
|
||||
services = delrepl.conn.get_entries(master_dn,
|
||||
delrepl.conn.SCOPE_ONELEVEL)
|
||||
except errors.NotFound:
|
||||
continue
|
||||
services_cns = [s.single_value('cn') for s in services]
|
||||
|
||||
if master_cn == hostname:
|
||||
@ -690,7 +693,7 @@ def del_master(realm, hostname, options):
|
||||
"from %s: %s" % (hostname, r, e))
|
||||
|
||||
# 5. Clean RUV for the deleted master
|
||||
if repltype == replication.IPA_REPLICA:
|
||||
if repltype == replication.IPA_REPLICA and rid is not None:
|
||||
try:
|
||||
thisrepl.cleanallruv(rid)
|
||||
except KeyboardInterrupt:
|
||||
|
Loading…
Reference in New Issue
Block a user