From fd92652ace1ab95e850c256f0ecca50ded79debf Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Thu, 27 Mar 2008 09:33:01 -0400 Subject: 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 --- ipa-server/ipa-install/ipa-replica-manage | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ipa-server/ipa-install/ipa-replica-manage') 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" -- cgit