def get_gm_member(self): session = self.context.session members = dbi.get_members(session, grid_id=self.grid_id, member_type=const.MEMBER_TYPE_GRID_MASTER, member_status=const.MEMBER_STATUS_ON) if not members or len(members) != 1: raise exc.InfobloxCannotFindMember(member="GM") return members[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
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
def _get_delegated_member(self, network_dict): delegated_member = None if (network_dict.get('cloud_info') and network_dict['cloud_info'].get('delegated_member')): delegated_member_name = ( network_dict['cloud_info']['delegated_member']['name']) delegated_member = utils.find_one_in_list('member_name', delegated_member_name, self.db_members) if not delegated_member: raise exc.InfobloxCannotFindMember( member=delegated_member_name) return delegated_member