mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Check if replication agreement exist before enable/disable it
If the replication agreement does not exist, a custom exception is raised explaining the problem. https://pagure.io/freeipa/issue/7201 Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
committed by
Christian Heimes
parent
1785a3e17b
commit
ece17cef17
@@ -1206,8 +1206,11 @@ def re_initialize(realm, thishost, fromhost, dirman_passwd, nolookup=False):
|
||||
repl = replication.ReplicationManager(realm, fromhost, dirman_passwd)
|
||||
agreement = repl.get_replication_agreement(thishost)
|
||||
|
||||
thisrepl.enable_agreement(fromhost)
|
||||
repl.enable_agreement(thishost)
|
||||
try:
|
||||
thisrepl.enable_agreement(fromhost)
|
||||
repl.enable_agreement(thishost)
|
||||
except errors.NotFound as e:
|
||||
sys.exit(e)
|
||||
|
||||
repl.force_sync(repl.conn, thishost)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user