summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2016-06-15 16:10:26 +0200
committerMartin Basti <mbasti@redhat.com>2016-06-17 18:05:03 +0200
commitef12cad30b3fc867b3b09abe6521c168dbc3ceaf (patch)
tree3a0413b511b390fde4e2904605a738330b0ea728 /ipaserver
parent4a7345e44804cf14f664814a2ab60f7a43ffa4ee (diff)
downloadfreeipa-ef12cad30b3fc867b3b09abe6521c168dbc3ceaf.tar.gz
freeipa-ef12cad30b3fc867b3b09abe6521c168dbc3ceaf.tar.xz
freeipa-ef12cad30b3fc867b3b09abe6521c168dbc3ceaf.zip
DNS Locations: set proper substitution variable
DNS Server (bind-dyndb-ldap) needs to have set 'idnsSubstitutionVariable;ipalocation' in ldap to the proper location https://fedorahosted.org/freeipa/ticket/2008 Reviewed-By: Petr Spacek <pspacek@redhat.com>
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/plugins/server.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/ipaserver/plugins/server.py b/ipaserver/plugins/server.py
index 344756f00..a39d26885 100644
--- a/ipaserver/plugins/server.py
+++ b/ipaserver/plugins/server.py
@@ -232,6 +232,26 @@ class server_mod(LDAPUpdate):
assert isinstance(dn, DN)
self.obj.get_enabled_roles(entry_attrs)
+ if 'ipalocation_location' in options:
+ ipalocation = entry_attrs.get('ipalocation')
+ if ipalocation:
+ ipalocation = ipalocation[0]['idnsname']
+ else:
+ ipalocation = u''
+ try:
+ self.api.Command.dnsserver_mod(
+ keys[0],
+ setattr=[
+ u'idnsSubstitutionVariable;ipalocation={loc}'.format(
+ loc=ipalocation)
+ ]
+ )
+ except errors.EmptyModlist:
+ pass
+ except errors.NotFound:
+ # server is not DNS server
+ pass
+
if 'ipalocation' or 'ipalocationweight' in entry_attrs:
result = self.api.Command.dns_update_system_records()
if not result.get('value'):