summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2014-06-12 18:07:40 +0200
committerMartin Kosek <mkosek@redhat.com>2014-07-02 16:16:09 +0200
commit8c98561c209d0ccaa692a335e3e9a10aec23ee0e (patch)
treede2654406d249aa166dd10dc854abd46dcfdd113
parenta5bb758978ffdccc5a985487d57856290428abf1 (diff)
downloadfreeipa-8c98561c209d0ccaa692a335e3e9a10aec23ee0e.tar.gz
freeipa-8c98561c209d0ccaa692a335e3e9a10aec23ee0e.tar.xz
freeipa-8c98561c209d0ccaa692a335e3e9a10aec23ee0e.zip
Do not fail if there are multiple nsDS5ReplicaId values in cn=replication,cn=etc
On systems installed before #3394 was fixed and nsDS5ReplicaId became single-valued, there are two replica ID values stored in cn=replication: the default (3) and the actual value we want. Instead of failing when multiple values are found, use the largest one. https://fedorahosted.org/freeipa/ticket/4375 Reviewed-By: Martin Kosek <mkosek@redhat.com>
-rw-r--r--ipaserver/install/replication.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py
index 2805624af..fbbad5e6c 100644
--- a/ipaserver/install/replication.py
+++ b/ipaserver/install/replication.py
@@ -238,12 +238,17 @@ class ReplicationManager(object):
root_logger.debug("Unable to retrieve nsDS5ReplicaId from remote server")
raise
else:
- if replica.single_value.get('nsDS5ReplicaId') is None:
+ id_values = replica.get('nsDS5ReplicaId')
+ if not id_values:
root_logger.debug("Unable to retrieve nsDS5ReplicaId from remote server")
raise RuntimeError("Unable to retrieve nsDS5ReplicaId from remote server")
+ # nsDS5ReplicaId is single-valued now, but historically it could
+ # contain multiple values, of which we need the highest.
+ # see bug: https://fedorahosted.org/freeipa/ticket/3394
+ retval = max(int(v) for v in id_values)
+
# Now update the value on the master
- retval = int(replica.single_value['nsDS5ReplicaId'])
mod = [(ldap.MOD_REPLACE, 'nsDS5ReplicaId', str(retval + 1))]
try: