mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Sort SRV records by priority
In some cases where multiple SRV records are present, LDAP and Kerberos records were returned in different order, causing replication issues in a multi master enviorment. Update ipadiscovery.py Reviewed-By: Christian Heimes <cheimes@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
parent
b03ede8796
commit
8ec8e24015
@ -17,6 +17,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
import operator
|
||||
import socket
|
||||
|
||||
import six
|
||||
@ -493,6 +494,7 @@ class IPADiscovery(object):
|
||||
|
||||
try:
|
||||
answers = resolver.query(qname, rdatatype.SRV)
|
||||
answers = sorted(answers, key=operator.attrgetter('priority'))
|
||||
except DNSException as e:
|
||||
root_logger.debug("DNS record not found: %s", e.__class__.__name__)
|
||||
answers = []
|
||||
|
Loading…
Reference in New Issue
Block a user