예제 #1
0
 def _get_dhcp_members(self, ib_network):
     dhcp_members = []
     member_ips = utils.get_dhcp_member_ips(ib_network)
     for member_ip in member_ips:
         dhcp_member = utils.find_in_list_by_value(
             member_ip, self.discovered_grid_members)
         if not dhcp_member:
             raise exc.InfobloxCannotFindMember(member=member_ip)
         dhcp_members.append(dhcp_member)
     return dhcp_members
예제 #2
0
 def _get_dhcp_members(self, ib_network):
     dhcp_members = []
     member_ips = utils.get_dhcp_member_ips(ib_network)
     for member_ip in member_ips:
         dhcp_member = utils.find_in_list_by_value(
             member_ip, self.discovered_grid_members)
         if not dhcp_member:
             raise exc.InfobloxCannotFindMember(member=member_ip)
         dhcp_members.append(dhcp_member)
     return dhcp_members
예제 #3
0
 def _get_dhcp_members(self, network_dict):
     # multiple dhcp members can be assigned to a network
     dhcp_members = []
     member_ips = utils.get_dhcp_member_ips(network_dict)
     for member_ip in member_ips:
         dhcp_member = utils.find_in_list_by_value(member_ip,
                                                   self.db_members)
         if not dhcp_member:
             raise exc.InfobloxCannotFindMember(member=member_ip)
         dhcp_members.append(dhcp_member)
     return dhcp_members
예제 #4
0
 def test_get_dhcp_member_ips_from_network_json(self):
     network_json = {
         "members": [{
             "_struct": "dhcpmember",
             "ipv4addr": "192.168.1.10",
             "ipv6addr": None,
             "name": "nios-7.2.0-member3.com"
         }]
     }
     member_ips = utils.get_dhcp_member_ips(network_json)
     self.assertEqual("192.168.1.10", member_ips[0])
예제 #5
0
    def test_get_dhcp_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.members = [
            ib_objects.AnyMember(_struct='dhcpmember',
                                 name='nios-7.2.0-member3.com',
                                 ipv4addr='192.168.1.10')]

        member_ips = utils.get_dhcp_member_ips(test_ib_network)
        self.assertEqual("192.168.1.10", member_ips[0])
예제 #6
0
 def _get_dhcp_members(self, network_dict):
     # multiple dhcp members can be assigned to a network
     dhcp_members = []
     member_ips = utils.get_dhcp_member_ips(network_dict)
     for member_ip in member_ips:
         dhcp_member = utils.find_in_list_by_value(member_ip,
                                                   self.db_members)
         if not dhcp_member:
             raise exc.InfobloxCannotFindMember(
                 member=member_ip)
         dhcp_members.append(dhcp_member)
     return dhcp_members
예제 #7
0
 def _get_dhcp_members(self, network_dict):
     # multiple dhcp members can be assigned to a network
     dhcp_members = []
     member_ips = utils.get_dhcp_member_ips(network_dict)
     for member_ip in member_ips:
         dhcp_member = utils.find_in_list_by_value(member_ip,
                                                   self.db_members)
         if not dhcp_member:
             LOG.warning("Member not found with dhcp_ip: %r", member_ip)
             continue
         dhcp_members.append(dhcp_member)
     return dhcp_members
예제 #8
0
 def test_get_dhcp_member_ips_from_network_json(self):
     network_json = {
         "members": [
             {
                 "_struct": "dhcpmember",
                 "ipv4addr": "192.168.1.10",
                 "ipv6addr": None,
                 "name": "nios-7.2.0-member3.com"
             }
         ]
     }
     member_ips = utils.get_dhcp_member_ips(network_json)
     self.assertEqual("192.168.1.10", member_ips[0])