diff options
author | Karl MacMillan <kmacmill@redhat.com> | 2007-10-19 13:22:27 -0400 |
---|---|---|
committer | Karl MacMillan <kmacmill@redhat.com> | 2007-10-19 13:22:27 -0400 |
commit | 086193af0a375908b619116ca80de6dc4410d1a2 (patch) | |
tree | 7dd6109a1f1db9a05a2203f4f84ea87fbac1b132 /ipa-server | |
parent | c4bd800b37f5056316095f0ff66bae2190eb9228 (diff) | |
download | freeipa-086193af0a375908b619116ca80de6dc4410d1a2.tar.gz freeipa-086193af0a375908b619116ca80de6dc4410d1a2.tar.xz freeipa-086193af0a375908b619116ca80de6dc4410d1a2.zip |
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.
Diffstat (limited to 'ipa-server')
-rw-r--r-- | ipa-server/ipaserver/dsinstance.py | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/ipa-server/ipaserver/dsinstance.py b/ipa-server/ipaserver/dsinstance.py index 0a6bdfc9b..a3bc3a449 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 |