'Helper function to retrieve the fips associated with a port_id.'

def _get_floatingips_by_port_id(self, context, port_id):

    fip_qry = context.session.query(l3_models.FloatingIP)
    return fip_qry.filter_by(fixed_port_id=port_id).all()
