summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipa-install/ipa-replica-manage
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2008-03-27 09:33:01 -0400
committerRob Crittenden <rcritten@redhat.com>2008-03-27 09:33:01 -0400
commitfd92652ace1ab95e850c256f0ecca50ded79debf (patch)
treedc900202332e7ab2a296a47ee360e9cecfe6a7f0 /ipa-server/ipa-install/ipa-replica-manage
parent1a1e02025824ba86ca847d59435541545b6f0aec (diff)
downloadfreeipa-fd92652ace1ab95e850c256f0ecca50ded79debf.tar.gz
freeipa-fd92652ace1ab95e850c256f0ecca50ded79debf.tar.xz
freeipa-fd92652ace1ab95e850c256f0ecca50ded79debf.zip
Make the memberof task a public function.
This is used when a new replica is created as well as whenever a replica is re-initialized from another master. In order for this to work when not creating an instance the __init__ function needs to be able to determine the suffix and the dm_password is needed. I've also added the time to the RDN of the member task to ensure uniqueness. 438222
Diffstat (limited to 'ipa-server/ipa-install/ipa-replica-manage')
-rw-r--r--ipa-server/ipa-install/ipa-replica-manage6
1 files changed, 4 insertions, 2 deletions
diff --git a/ipa-server/ipa-install/ipa-replica-manage b/ipa-server/ipa-install/ipa-replica-manage
index f5e93f41b..6761a0e53 100644
--- a/ipa-server/ipa-install/ipa-replica-manage
+++ b/ipa-server/ipa-install/ipa-replica-manage
@@ -78,7 +78,7 @@ def del_master(replman, hostname):
def add_master(replman, hostname):
replman.setup_replication(hostname, get_realm_name())
-def init_master(replman, hostname):
+def init_master(replman, dirman_passwd, hostname):
filter = "(&(nsDS5ReplicaHost=%s)(objectclass=nsds5ReplicationAgreement))" % hostname
entry = replman.conn.search_s("cn=config", ldap.SCOPE_SUBTREE, filter)
if len(entry) == 0:
@@ -87,6 +87,8 @@ def init_master(replman, hostname):
if len(entry) > 1:
logging.error("Found multiple agreements for %s. Only initializing the first one returned: %s" % (hostname, entry[0].dn))
replman.initialize_replication(entry[0].dn, replman.conn)
+ ds = dsinstance.DsInstance(realm_name = get_realm_name(), dm_password = dirman_passwd)
+ ds.init_memberof()
def synch_master(replman, hostname):
filter = "(&(nsDS5ReplicaHost=%s)(objectclass=nsds5ReplicationAgreement))" % hostname
@@ -130,7 +132,7 @@ def main():
if len(args) != 2:
print "hostname of supplier to initialize from is required."
sys.exit(1)
- init_master(r, args[1])
+ init_master(r, dirman_passwd, args[1])
elif args[0] == "synch":
if len(args) != 2:
print "must provide hostname of supplier to synchronize with"