mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
fix force-sync, re-initialize of replica and a check for replication agreement existence
in other words limit usage of `agreement_dn` method only for manipulation and search of agreements which are not managed by topology plugin. For other cases is safer to search for the agreement. https://fedorahosted.org/freeipa/ticket/5066 Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
parent
f9cbdd4915
commit
dcb6916a3b
@ -1167,10 +1167,8 @@ class ReplicationManager(object):
|
|||||||
conn.modify_s(dn, mod)
|
conn.modify_s(dn, mod)
|
||||||
|
|
||||||
def get_agreement_type(self, hostname):
|
def get_agreement_type(self, hostname):
|
||||||
cn, dn = self.agreement_dn(hostname)
|
|
||||||
|
|
||||||
entry = self.conn.get_entry(dn)
|
|
||||||
|
|
||||||
|
entry = self.get_replication_agreement(hostname)
|
||||||
objectclass = entry.get("objectclass")
|
objectclass = entry.get("objectclass")
|
||||||
|
|
||||||
for o in objectclass:
|
for o in objectclass:
|
||||||
@ -1578,9 +1576,7 @@ class ReplicationManager(object):
|
|||||||
"""
|
"""
|
||||||
Disable the replication agreement to hostname.
|
Disable the replication agreement to hostname.
|
||||||
"""
|
"""
|
||||||
cn, dn = self.agreement_dn(hostname)
|
entry = self.get_replication_agreement(hostname)
|
||||||
|
|
||||||
entry = self.conn.get_entry(dn)
|
|
||||||
entry['nsds5ReplicaEnabled'] = 'off'
|
entry['nsds5ReplicaEnabled'] = 'off'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -1594,9 +1590,7 @@ class ReplicationManager(object):
|
|||||||
|
|
||||||
Note: for replication to work it needs to be enabled both ways.
|
Note: for replication to work it needs to be enabled both ways.
|
||||||
"""
|
"""
|
||||||
cn, dn = self.agreement_dn(hostname)
|
entry = self.get_replication_agreement(hostname)
|
||||||
|
|
||||||
entry = self.conn.get_entry(dn)
|
|
||||||
entry['nsds5ReplicaEnabled'] = 'on'
|
entry['nsds5ReplicaEnabled'] = 'on'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -408,13 +408,7 @@ def install_check(installer):
|
|||||||
config.dirman_password)
|
config.dirman_password)
|
||||||
|
|
||||||
# Check that we don't already have a replication agreement
|
# Check that we don't already have a replication agreement
|
||||||
try:
|
if replman.get_replication_agreement(config.host_name):
|
||||||
(agreement_cn, agreement_dn) = replman.agreement_dn(
|
|
||||||
config.host_name)
|
|
||||||
entry = conn.get_entry(agreement_dn, ['*'])
|
|
||||||
except errors.NotFound:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
root_logger.info('Error: A replication agreement for this '
|
root_logger.info('Error: A replication agreement for this '
|
||||||
'host already exists.')
|
'host already exists.')
|
||||||
print('A replication agreement for this host already exists. '
|
print('A replication agreement for this host already exists. '
|
||||||
|
Loading…
Reference in New Issue
Block a user