Example #1
0
 def _get_dns_members(self, network_dict):
     # multiple dns members can be assigned to a network
     dns_members = []
     member_ips = utils.get_dns_member_ips(network_dict)
     for member_ip in member_ips:
         dns_member = utils.find_in_list_by_value(member_ip,
                                                  self.db_members)
         if dns_member:
             dns_members.append(dns_member)
     return dns_members
Example #2
0
 def _get_dns_members(self, network_dict):
     # multiple dns members can be assigned to a network
     dns_members = []
     member_ips = utils.get_dns_member_ips(network_dict)
     for member_ip in member_ips:
         dns_member = utils.find_in_list_by_value(member_ip,
                                                  self.db_members)
         if dns_member:
             dns_members.append(dns_member)
     return dns_members
Example #3
0
 def test_get_dns_member_ips_from_ib_network(self):
     connector = mock.Mock()
     test_ib_network = ib_objects.NetworkV4(connector,
                                            network_view='test-view',
                                            cidr='12.12.1.0/24')
     test_ib_network.options = [
         ib_objects.DhcpOption(name='domain-name-servers',
                               value='192.168.1.10,192.168.1.13')]
     member_ips = utils.get_dns_member_ips(test_ib_network)
     self.assertEqual("192.168.1.10", member_ips[0])
     self.assertEqual("192.168.1.13", member_ips[1])
Example #4
0
 def _get_dns_members(self, ib_network):
     # multiple dns members can be assigned to a network
     dns_members = []
     member_ips = utils.get_dns_member_ips(ib_network)
     for member_ip in member_ips:
         dns_member = utils.find_in_list_by_value(
             member_ip, self.discovered_grid_members)
         # we do not care user specified dns servers
         if dns_member:
             dns_members.append(dns_member)
     return dns_members
Example #5
0
 def _get_dns_members(self, ib_network):
     # multiple dns members can be assigned to a network
     dns_members = []
     member_ips = utils.get_dns_member_ips(ib_network)
     for member_ip in member_ips:
         dns_member = utils.find_in_list_by_value(
             member_ip, self.discovered_grid_members)
         # we do not care user specified dns servers
         if dns_member:
             dns_members.append(dns_member)
     return dns_members
Example #6
0
 def test_get_dns_member_ips_from_network_json(self):
     network_json = {
         "options": [{
             "name": "domain-name-servers",
             "num": 6,
             "use_option": True,
             "value": "192.168.1.10,192.168.1.13",
             "vendor_class": "DHCP"
         }]
     }
     member_ips = utils.get_dns_member_ips(network_json)
     self.assertEqual("192.168.1.10", member_ips[0])
     self.assertEqual("192.168.1.13", member_ips[1])
 def test_get_dns_member_ips_from_network_json(self):
     network_json = {
         "options": [
             {
                 "name": "domain-name-servers",
                 "num": 6,
                 "use_option": True,
                 "value": "192.168.1.10,192.168.1.13",
                 "vendor_class": "DHCP"
             }
         ]
     }
     member_ips = utils.get_dns_member_ips(network_json)
     self.assertEqual("192.168.1.10", member_ips[0])
     self.assertEqual("192.168.1.13", member_ips[1])