'Returns the subnet_id that matches the fixedip on a network.'

def _get_subnet_id_for_given_fixed_ip(self, context, fixed_ip, port_dict):

    filters = {'network_id': [port_dict['network_id']]}
    subnets = self._core_plugin.get_subnets(context, filters)
    for subnet in subnets:
        if ipam_utils.check_subnet_ip(subnet['cidr'], fixed_ip):
            return subnet['id']
