dns_hub: Minor variable rename
authorTim Beale <timbeale@catalyst.net.nz>
Wed, 20 Feb 2019 03:41:47 +0000 (16:41 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 5 Mar 2019 23:27:31 +0000 (23:27 +0000)
We've dropped the iface logic now - this dictionary maps from
realm-to-IP.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/target/dns_hub.py

index 00c1ebdbfb243cfbd2d181b62e0766b8373c4f8c..f1a5eee2b54ce1d06361bd0b8a7f5ae2a69910fc 100755 (executable)
@@ -72,15 +72,16 @@ class DnsHandler(sserver.BaseRequestHandler):
     def get_pdc_ipv4_addr(self, lookup_name):
         """Maps a DNS realm to the IPv4 address of the PDC for that testenv"""
 
-        testenv_iface_mapping = self.server.realm_to_ip_mappings
+        realm_to_ip_mappings = self.server.realm_to_ip_mappings
 
         # sort the realms so we find the longest-match first
-        testenv_realms = sorted(testenv_iface_mapping.keys(), key=len)
+        testenv_realms = sorted(realm_to_ip_mappings.keys(), key=len)
         testenv_realms.reverse()
 
         for realm in testenv_realms:
             if lookup_name.endswith(realm):
-                return testenv_iface_mapping[realm]
+                # return the corresponding IP address for this realm's PDC
+                return realm_to_ip_mappings[realm]
 
         return None