'Raises if floating IP does not belong to project.'

def _floating_ip_owned_by_project(self, context, floating_ip):

    if context.is_admin:
        return
    if (floating_ip.project_id != context.project_id):
        if (floating_ip.project_id is None):
            LOG.warning(_LW('Address    |%(address)s|    is    not    allocated'), {'address': floating_ip.address})
            raise exception.Forbidden()
        else:
            LOG.warning(_LW('Address    |%(address)s|    is    not    allocated    to    your    project    |%(project)s|'), {'address': floating_ip.address, 'project': context.project_id})
            raise exception.Forbidden()
