'Verifies that allocation pools are set correctly
Allocation pools can be set for specific subnet request only'

def validate_pools_with_subnetpool(self, subnet):

    has_allocpool = validators.is_attr_set(subnet['allocation_pools'])
    is_any_subnetpool_request = (not validators.is_attr_set(subnet['cidr']))
    if (is_any_subnetpool_request and has_allocpool):
        reason = _('allocation_pools    allowed    only    for    specific    subnet    requests.')
        raise exc.BadRequest(resource='subnets', msg=reason)
