From 086193af0a375908b619116ca80de6dc4410d1a2 Mon Sep 17 00:00:00 2001 From: Karl MacMillan Date: Fri, 19 Oct 2007 13:22:27 -0400 Subject: Remove the use of uuid in the directory server instance name. The use of a uuid for the DS instance name is overkill and it is a real pain. This patch will use ipa-realm-name instead (resulting in something like slapd-EXAMPLE-COM). All periods are converted to "-" because the DS can't handle periods in server ids. --- ipa-server/ipaserver/dsinstance.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'ipa-server/ipaserver/dsinstance.py') diff --git a/ipa-server/ipaserver/dsinstance.py b/ipa-server/ipaserver/dsinstance.py index 0a6bdfc9..a3bc3a44 100644 --- a/ipa-server/ipaserver/dsinstance.py +++ b/ipa-server/ipaserver/dsinstance.py @@ -35,18 +35,6 @@ def ldap_mod(fd, dn, pwd): args = ["/usr/bin/ldapmodify", "-h", "127.0.0.1", "-xv", "-D", dn, "-w", pwd, "-f", fd.name] run(args) -def generate_serverid(): - """Generate a UUID (universally unique identifier) suitable - for use as a unique identifier for a DS instance. - """ - try: - import uuid - id = str(uuid.uuid1()) - except ImportError: - import commands - id = commands.getoutput("/usr/bin/uuidgen") - return id - def realm_to_suffix(realm_name): s = realm_name.split(".") terms = ["dc=" + x.lower() for x in s] @@ -82,8 +70,8 @@ class DsInstance: def create_instance(self, ds_user, realm_name, host_name, dm_password): self.ds_user = ds_user - self.serverid = generate_serverid() self.realm_name = realm_name.upper() + self.serverid = "-".join(self.realm_name.split(".")) self.suffix = realm_to_suffix(self.realm_name) self.host_name = host_name self.dm_password = dm_password -- cgit