diff -r 09ea088df0ec ipa-server/ipaserver/dsinstance.py
--- a/ipa-server/ipaserver/dsinstance.py	Thu Jan 24 13:08:09 2008 +0000
+++ b/ipa-server/ipaserver/dsinstance.py	Thu Jan 24 13:51:12 2008 +0000
@@ -31,6 +31,9 @@ import certs
 import certs
 import ipaldap, ldap
 
+SERVERID = "IPA"
+CONFIG_DIRNAME = os.path.join("/etc/dirsrv", "slapd-" + SERVERID)
+SCHEMA_DIRNAME = os.path.join(CONFIG_DIRNAME, "schema")
 SERVER_ROOT_64 = "/usr/lib64/dirsrv"
 SERVER_ROOT_32 = "/usr/lib/dirsrv"
 
@@ -44,15 +47,6 @@ def find_server_root():
         return SERVER_ROOT_64
     else:
         return SERVER_ROOT_32
-
-def realm_to_serverid(realm_name):
-    return "-".join(realm_name.split("."))
-
-def config_dirname(serverid):
-    return "/etc/dirsrv/slapd-" + serverid + "/"
-
-def schema_dirname(serverid):
-    return config_dirname(serverid) + "/schema/"
 
 def erase_ds_instance_data(serverid):
     try:
@@ -100,7 +94,6 @@ class DsInstance(service.Service):
 class DsInstance(service.Service):
     def __init__(self):
         service.Service.__init__(self, "dirsrv")
-        self.serverid = None
         self.realm_name = None
         self.suffix = None
         self.host_name = None
@@ -111,7 +104,6 @@ class DsInstance(service.Service):
     def install(self, ds_user, realm_name, host_name, dm_password, pkcs12_info=None):
         self.ds_user = ds_user
         self.realm_name = realm_name.upper()
-        self.serverid = realm_to_serverid(self.realm_name)
         self.suffix = realm_to_suffix(self.realm_name)
         self.host_name = host_name
         self.dm_password = dm_password
@@ -164,12 +156,11 @@ class DsInstance(service.Service):
 
     def __create_instance(self):
         self.backup_state("running", self.is_running())
-        self.backup_state("serverid", self.serverid)
         inf_txt = ipautil.template_str(INF_TEMPLATE, 
                                        FQHN = self.host_name,
                                        USER = self.ds_user,
                                        SERVER_ROOT = find_server_root(),
-                                       SERVERID = self.serverid,
+                                       SERVERID = SERVERID,
                                        SUFFIX = self.suffix,
                                        PASSWORD = self.dm_password)
         logging.debug(inf_txt)
@@ -196,13 +187,13 @@ class DsInstance(service.Service):
 
     def __add_default_schemas(self):
         shutil.copyfile(ipautil.SHARE_DIR + "60kerberos.ldif",
-                        schema_dirname(self.serverid) + "60kerberos.ldif")
+                        os.path.join(SCHEMA_DIRNAME, "60kerberos.ldif"))
         shutil.copyfile(ipautil.SHARE_DIR + "60samba.ldif",
-                        schema_dirname(self.serverid) + "60samba.ldif")
+                        os.path.join(SCHEMA_DIRNAME, "60samba.ldif"))
         shutil.copyfile(ipautil.SHARE_DIR + "60radius.ldif",
-                        schema_dirname(self.serverid) + "60radius.ldif")
+                        os.path.join(SCHEMA_DIRNAME, "60radius.ldif"))
         shutil.copyfile(ipautil.SHARE_DIR + "60ipaconfig.ldif",
-                        schema_dirname(self.serverid) + "60ipaconfig.ldif")
+                        os.path.join(SCHEMA_DIRNAME, "60ipaconfig.ldif"))
 
     def __restart_instance(self):
         try:
@@ -252,8 +243,7 @@ class DsInstance(service.Service):
                         FQHN = self.host_name)
 
     def __enable_ssl(self):
-        dirname = config_dirname(self.serverid)
-        ca = certs.CertDB(dirname)
+        ca = certs.CertDB(CONFIG_DIRNAME)
         if self.pkcs12_info:
             ca.create_from_pkcs12(self.pkcs12_info[0], self.pkcs12_info[1])
             ca.cur_serial = 2100
@@ -299,18 +289,18 @@ class DsInstance(service.Service):
 
     def __certmap_conf(self):
         shutil.copyfile(ipautil.SHARE_DIR + "certmap.conf.template",
-                        config_dirname(self.serverid) + "certmap.conf")
+                        os.path.join(CONFIG_DIRNAME, "certmap.conf"))
 
     def change_admin_password(self, password):
         logging.debug("Changing admin password")
-        dirname = config_dirname(self.serverid)
         if ipautil.dir_exists("/usr/lib64/mozldap"):
             app = "/usr/lib64/mozldap/ldappasswd"
         else:
             app = "/usr/lib/mozldap/ldappasswd"
         args = [app,
                 "-D", "cn=Directory Manager", "-w", self.dm_password,
-                "-P", dirname+"/cert8.db", "-ZZZ", "-s", password,
+                "-P", os.path.join(CONFIG_DIRNAME, "cert8.db"),
+                "-ZZZ", "-s", password,
                 "uid=admin,cn=sysaccounts,cn=etc,"+self.suffix]
         try:
             ipautil.run(args)
@@ -329,9 +319,7 @@ class DsInstance(service.Service):
         if not enabled is None and not enabled:
             self.chkconfig_off()
 
-        serverid = self.restore_state("serverid")
-        if not serverid is None:
-            erase_ds_instance_data(serverid)
+        erase_ds_instance_data(SERVERID)
 
         ds_user = self.restore_state("user")
         user_exists = self.restore_state("user_exists")
diff -r 09ea088df0ec ipa-server/ipaserver/httpinstance.py
--- a/ipa-server/ipaserver/httpinstance.py	Thu Jan 24 13:08:09 2008 +0000
+++ b/ipa-server/ipaserver/httpinstance.py	Thu Jan 24 13:51:12 2008 +0000
@@ -143,7 +143,7 @@ class HTTPInstance(service.Service):
             print "Updating %s failed." % NSS_CONF
 
     def __setup_ssl(self):
-        ds_ca = certs.CertDB(dsinstance.config_dirname(dsinstance.realm_to_serverid(self.realm)))
+        ds_ca = certs.CertDB(dsinstance.CONFIG_DIRNAME)
         ca = certs.CertDB(NSS_DIR)
         ds_ca.cur_serial = 2000
         ca.create_from_cacert(ds_ca.cacert_fname)
@@ -158,7 +158,7 @@ class HTTPInstance(service.Service):
         prefs_fd.close()                
 
         # The signing cert is generated in __setup_ssl
-        ds_ca = certs.CertDB(dsinstance.config_dirname(dsinstance.realm_to_serverid(self.realm)))
+        ds_ca = certs.CertDB(dsinstance.CONFIG_DIRNAME)
         ca = certs.CertDB(NSS_DIR)
 
         # Publish the CA certificate
