mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 16:10:02 -06:00
Turn replication manager group into ReplicationManager class member
https://fedorahosted.org/freeipa/ticket/6406 Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
parent
9102fb3b02
commit
9d7943f3da
@ -125,6 +125,7 @@ DEFAULT_CONFIG = (
|
|||||||
('container_ca', DN(('cn', 'cas'), ('cn', 'ca'))),
|
('container_ca', DN(('cn', 'cas'), ('cn', 'ca'))),
|
||||||
('container_dnsservers', DN(('cn', 'servers'), ('cn', 'dns'))),
|
('container_dnsservers', DN(('cn', 'servers'), ('cn', 'dns'))),
|
||||||
('container_custodia', DN(('cn', 'custodia'), ('cn', 'ipa'), ('cn', 'etc'))),
|
('container_custodia', DN(('cn', 'custodia'), ('cn', 'ipa'), ('cn', 'etc'))),
|
||||||
|
('container_sysaccounts', DN(('cn', 'sysaccounts'), ('cn', 'etc'))),
|
||||||
|
|
||||||
# Ports, hosts, and URIs:
|
# Ports, hosts, and URIs:
|
||||||
('xmlrpc_uri', 'http://localhost:8888/ipa/xml'),
|
('xmlrpc_uri', 'http://localhost:8888/ipa/xml'),
|
||||||
|
@ -50,6 +50,7 @@ DEFAULT_PORT = 389
|
|||||||
TIMEOUT = 120
|
TIMEOUT = 120
|
||||||
REPL_MAN_DN = DN(('cn', 'replication manager'), ('cn', 'config'))
|
REPL_MAN_DN = DN(('cn', 'replication manager'), ('cn', 'config'))
|
||||||
DNA_DN = DN(('cn', 'Posix IDs'), ('cn', 'Distributed Numeric Assignment Plugin'), ('cn', 'plugins'), ('cn', 'config'))
|
DNA_DN = DN(('cn', 'Posix IDs'), ('cn', 'Distributed Numeric Assignment Plugin'), ('cn', 'plugins'), ('cn', 'config'))
|
||||||
|
REPL_MANAGERS_CN = DN(('cn', 'replication managers'))
|
||||||
|
|
||||||
IPA_REPLICA = 1
|
IPA_REPLICA = 1
|
||||||
WINSYNC = 2
|
WINSYNC = 2
|
||||||
@ -232,6 +233,8 @@ class ReplicationManager(object):
|
|||||||
# at runtime if you really want
|
# at runtime if you really want
|
||||||
self.repl_man_dn = REPL_MAN_DN
|
self.repl_man_dn = REPL_MAN_DN
|
||||||
self.repl_man_cn = "replication manager"
|
self.repl_man_cn = "replication manager"
|
||||||
|
self.repl_man_group_dn = DN(
|
||||||
|
REPL_MANAGERS_CN, api.env.container_sysaccounts, api.env.basedn)
|
||||||
|
|
||||||
def _get_replica_id(self, conn, master_conn):
|
def _get_replica_id(self, conn, master_conn):
|
||||||
"""
|
"""
|
||||||
@ -438,9 +441,6 @@ class ReplicationManager(object):
|
|||||||
assert isinstance(replica_binddn, DN)
|
assert isinstance(replica_binddn, DN)
|
||||||
dn = self.replica_dn()
|
dn = self.replica_dn()
|
||||||
assert isinstance(dn, DN)
|
assert isinstance(dn, DN)
|
||||||
replica_groupdn = DN(
|
|
||||||
('cn', 'replication managers'), ('cn', 'sysaccounts'),
|
|
||||||
('cn', 'etc'), self.suffix)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
entry = conn.get_entry(dn)
|
entry = conn.get_entry(dn)
|
||||||
@ -454,9 +454,9 @@ class ReplicationManager(object):
|
|||||||
mod.append((ldap.MOD_ADD, 'nsDS5ReplicaBindDN',
|
mod.append((ldap.MOD_ADD, 'nsDS5ReplicaBindDN',
|
||||||
replica_binddn))
|
replica_binddn))
|
||||||
|
|
||||||
if replica_groupdn not in binddn_groups:
|
if self.repl_man_group_dn not in binddn_groups:
|
||||||
mod.append((ldap.MOD_ADD, 'nsds5replicabinddngroup',
|
mod.append((ldap.MOD_ADD, 'nsds5replicabinddngroup',
|
||||||
replica_groupdn))
|
self.repl_man_group_dn))
|
||||||
if mod:
|
if mod:
|
||||||
conn.modify_s(dn, mod)
|
conn.modify_s(dn, mod)
|
||||||
|
|
||||||
@ -476,7 +476,7 @@ class ReplicationManager(object):
|
|||||||
nsds5replicatype=[replica_type],
|
nsds5replicatype=[replica_type],
|
||||||
nsds5flags=["1"],
|
nsds5flags=["1"],
|
||||||
nsds5replicabinddn=[replica_binddn],
|
nsds5replicabinddn=[replica_binddn],
|
||||||
nsds5replicabinddngroup=[replica_groupdn],
|
nsds5replicabinddngroup=[self.repl_man_group_dn],
|
||||||
nsds5replicabinddngroupcheckinterval=["60"],
|
nsds5replicabinddngroupcheckinterval=["60"],
|
||||||
nsds5replicalegacyconsumer=["off"],
|
nsds5replicalegacyconsumer=["off"],
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user