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
This commit is contained in:
Rob Crittenden
2008-03-27 09:33:01 -04:00
parent 1a1e020258
commit fd92652ace
4 changed files with 30 additions and 15 deletions

View File

@@ -104,6 +104,8 @@ def install_ds(config):
ds = dsinstance.DsInstance()
ds.create_instance(config.ds_user, config.realm_name, config.host_name, config.domain_name, config.dirman_password, pkcs12_info)
return ds
def install_krb(config):
krb = krbinstance.KrbInstance()
ldappwd_filename = config.dir + "/ldappwd"
@@ -134,7 +136,7 @@ def install_http(config):
def main():
options, filename = parse_options()
installutils.standard_logging_setup("ipareplica-install.log", options.debug)
installutils.standard_logging_setup("/var/log/ipareplica-install.log", options.debug)
top_dir, dir = expand_info(filename)
@@ -180,7 +182,7 @@ def main():
ntp.create_instance()
# Configure dirsrv
install_ds(config)
ds = install_ds(config)
repl = replication.ReplicationManager(config.host_name, config.dirman_password)
if repl is None:
@@ -208,6 +210,9 @@ def main():
print "Configuration of client side components failed!"
print "ipa-client-install returned: " + str(e)
raise RuntimeError("Failed to configure the client")
ds.init_memberof()
try:
if not os.geteuid()==0:
sys.exit("\nYou must be root to run this script.\n")