summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2010-04-14 18:52:12 +0200
committerMartin Nagy <mnagy@redhat.com>2010-04-19 11:38:40 +0200
commit34ee09e2438d942ce43b3b687ee26836a9165a7e (patch)
treeab4fe0b351945142150b14db541fbbe22ba637e2 /ipaserver
parentbc5b5a82d9e55363a652d9675a1db6325e859b31 (diff)
downloadfreeipa-34ee09e2438d942ce43b3b687ee26836a9165a7e.tar.gz
freeipa-34ee09e2438d942ce43b3b687ee26836a9165a7e.tar.xz
freeipa-34ee09e2438d942ce43b3b687ee26836a9165a7e.zip
Fix ipa-dns-install. It was failing when DNS was reinstalling.
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/install/bindinstance.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py
index 105cf4e21..e72891197 100644
--- a/ipaserver/install/bindinstance.py
+++ b/ipaserver/install/bindinstance.py
@@ -263,7 +263,12 @@ class BindInstance(service.Service):
# Store the keytab on disk
self.fstore.backup_file("/etc/named.keytab")
installutils.create_keytab("/etc/named.keytab", dns_principal)
- dns_principal = self.move_service(dns_principal)
+ p = self.move_service(dns_principal)
+ if p is None:
+ # the service has already been moved, perhaps we're doing a DNS reinstall
+ dns_principal = "krbprincipalname=%s,cn=services,cn=accounts,%s" % (dns_principal, self.suffix)
+ else:
+ dns_principal = p
# Make sure access is strictly reserved to the named user
pent = pwd.getpwnam(self.named_user)
@@ -284,10 +289,14 @@ class BindInstance(service.Service):
raise e
dns_group = "cn=dnsserver,cn=rolegroups,cn=accounts,%s" % self.suffix
+ if isinstance(dns_principal, unicode):
+ dns_principal = dns_principal.encode('utf-8')
mod = [(ldap.MOD_ADD, 'member', dns_principal)]
try:
conn.modify_s(dns_group, mod)
+ except ldap.TYPE_OR_VALUE_EXISTS:
+ pass
except Exception, e:
logging.critical("Could not modify principal's %s entry" % dns_principal)
raise e