Fix ipa-adtrust-install to always generate SRV records with FQDNs

Previous code failed in following setup:
* IPA domain = ipa.example.com
* IPA master = vm1.example.com
* IPA replica = vm2.example.com

https://fedorahosted.org/freeipa/ticket/5663

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Petr Spacek
2016-02-02 17:20:21 +01:00
committed by Petr Vobornik
parent 348c400484
commit 72e4a360fc

View File

@@ -571,12 +571,7 @@ class ADTRUSTInstance(service.Service):
"""
zone = self.domain_name
host, host_domain = self.fqdn.split(".", 1)
if normalize_zone(zone) == normalize_zone(host_domain):
host_in_rr = host
else:
host_in_rr = normalize_zone(self.fqdn)
host_in_rr = normalize_zone(self.fqdn)
priority = 0
@@ -707,7 +702,7 @@ class ADTRUSTInstance(service.Service):
# this is CIFS service of a different host in our
# REALM, we need to remember it to announce via
# SRV records for _msdcs
self.cifs_hosts.append(fqdn.split(".")[0])
self.cifs_hosts.append(normalize_zone(fqdn))
except Exception as e:
root_logger.critical("Checking replicas for cifs principals failed with error '%s'" % e)