summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipaserver/dsinstance.py
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2008-02-28 13:35:10 -0500
committerSimo Sorce <ssorce@redhat.com>2008-02-28 13:35:10 -0500
commitd7ad62cd7e1d861270e8fd0ff8a2dd7ddba90127 (patch)
tree561f4707e7da63317879cbe2ccec74cce1db66b9 /ipa-server/ipaserver/dsinstance.py
parent2c559fce85df777fbe26eca163cb4ae93e12c448 (diff)
downloadfreeipa-d7ad62cd7e1d861270e8fd0ff8a2dd7ddba90127.tar.gz
freeipa-d7ad62cd7e1d861270e8fd0ff8a2dd7ddba90127.tar.xz
freeipa-d7ad62cd7e1d861270e8fd0ff8a2dd7ddba90127.zip
Make sure all entries are generated by us according to IPA
default tree. This patch make sure that the DS setup script does not add unwanted entries.
Diffstat (limited to 'ipa-server/ipaserver/dsinstance.py')
-rw-r--r--ipa-server/ipaserver/dsinstance.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/ipa-server/ipaserver/dsinstance.py b/ipa-server/ipaserver/dsinstance.py
index 99ebae50..4ed4ddf0 100644
--- a/ipa-server/ipaserver/dsinstance.py
+++ b/ipa-server/ipaserver/dsinstance.py
@@ -97,6 +97,16 @@ ServerIdentifier= $SERVERID
Suffix= $SUFFIX
RootDN= cn=Directory Manager
RootDNPwd= $PASSWORD
+InstallLdifFile= /var/lib/dirsrv/boot.ldif
+"""
+
+BASE_TEMPLATE = """
+dn: $SUFFIX
+objectClass: top
+objectClass: domain
+objectClass: pilotObject
+dc: $BASEDC
+info: IPA V1.0
"""
class DsInstance(service.Service):
@@ -177,6 +187,15 @@ class DsInstance(service.Service):
def __create_instance(self):
self.backup_state("running", self.is_running())
self.backup_state("serverid", self.serverid)
+
+ self.sub_dict['BASEDC'] = self.domain[:self.domain.find('.')]
+ base_txt = ipautil.template_str(BASE_TEMPLATE, self.sub_dict)
+ logging.debug(base_txt)
+ base_fd = file("/var/lib/dirsrv/boot.ldif", "w")
+ base_fd.write(base_txt)
+ base_fd.flush()
+ base_fd.close()
+
inf_txt = ipautil.template_str(INF_TEMPLATE, self.sub_dict)
logging.debug("writing inf template")
inf_fd = ipautil.write_tmp_file(inf_txt)
@@ -200,6 +219,8 @@ class DsInstance(service.Service):
except ipautil.CalledProcessError, e:
print "failed to restart ds instance", e
logging.debug("failed to restart ds instance %s" % e)
+ inf_fd.close()
+ os.remove("/var/lib/dirsrv/boot.ldif")
def __add_default_schemas(self):
shutil.copyfile(ipautil.SHARE_DIR + "60kerberos.ldif",