mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fix replication setup
Changes to add a cs-replication management tool mistakenly always set a flag that caused replicas to not add the list of attribute we exclude from replication.
This commit is contained in:
@@ -334,7 +334,7 @@ def add_link(realm, replica1, replica2, dirman_passwd, options):
|
|||||||
except Exception, e:
|
except Exception, e:
|
||||||
sys.exit("Failed to get data from '%s': %s" % (replica1, convert_error(e)))
|
sys.exit("Failed to get data from '%s': %s" % (replica1, convert_error(e)))
|
||||||
|
|
||||||
repl1.setup_replication(replica2, PORT, 0, "cn=Directory Manager", dirman_passwd, True)
|
repl1.setup_replication(replica2, PORT, 0, "cn=Directory Manager", dirman_passwd, True, True)
|
||||||
print "Connected '%s' to '%s'" % (replica1, replica2)
|
print "Connected '%s' to '%s'" % (replica1, replica2)
|
||||||
|
|
||||||
def re_initialize(realm, options):
|
def re_initialize(realm, options):
|
||||||
|
|||||||
@@ -673,7 +673,9 @@ class ReplicationManager(object):
|
|||||||
self.replica_config(conn, replica_id, repldn)
|
self.replica_config(conn, replica_id, repldn)
|
||||||
self.setup_changelog(conn)
|
self.setup_changelog(conn)
|
||||||
|
|
||||||
def setup_replication(self, r_hostname, r_port=389, r_sslport=636, r_binddn=None, r_bindpw=None, starttls=False):
|
def setup_replication(self, r_hostname, r_port=389, r_sslport=636,
|
||||||
|
r_binddn=None, r_bindpw=None, starttls=False,
|
||||||
|
is_cs_replica=False):
|
||||||
# note - there appears to be a bug in python-ldap - it does not
|
# note - there appears to be a bug in python-ldap - it does not
|
||||||
# allow connections using two different CA certs
|
# allow connections using two different CA certs
|
||||||
if starttls:
|
if starttls:
|
||||||
@@ -698,14 +700,22 @@ class ReplicationManager(object):
|
|||||||
self.basic_replication_setup(r_conn, r_id,
|
self.basic_replication_setup(r_conn, r_id,
|
||||||
self.repl_man_dn, self.repl_man_passwd)
|
self.repl_man_dn, self.repl_man_passwd)
|
||||||
|
|
||||||
self.setup_agreement(r_conn, self.conn.host, port=r_port,
|
if is_cs_replica:
|
||||||
repl_man_dn=self.repl_man_dn,
|
self.setup_agreement(r_conn, self.conn.host, port=r_port,
|
||||||
repl_man_passwd=self.repl_man_passwd,
|
repl_man_dn=self.repl_man_dn,
|
||||||
master=True)
|
repl_man_passwd=self.repl_man_passwd,
|
||||||
self.setup_agreement(self.conn, r_hostname, port=r_port,
|
master=True)
|
||||||
repl_man_dn=self.repl_man_dn,
|
self.setup_agreement(self.conn, r_hostname, port=r_port,
|
||||||
repl_man_passwd=self.repl_man_passwd,
|
repl_man_dn=self.repl_man_dn,
|
||||||
master=False)
|
repl_man_passwd=self.repl_man_passwd,
|
||||||
|
master=False)
|
||||||
|
else:
|
||||||
|
self.setup_agreement(r_conn, self.conn.host, port=r_port,
|
||||||
|
repl_man_dn=self.repl_man_dn,
|
||||||
|
repl_man_passwd=self.repl_man_passwd)
|
||||||
|
self.setup_agreement(self.conn, r_hostname, port=r_port,
|
||||||
|
repl_man_dn=self.repl_man_dn,
|
||||||
|
repl_man_passwd=self.repl_man_passwd)
|
||||||
|
|
||||||
#Finally start replication
|
#Finally start replication
|
||||||
ret = self.start_replication(r_conn, master=True)
|
ret = self.start_replication(r_conn, master=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user