'Update operational status for a floating IP.'

@db_api.retry_db_errors
def update_floatingip_statuses(self, context, router_id, fip_statuses):

    with context.session.begin(subtransactions=True):
        for (floatingip_id, status) in fip_statuses.items():
            LOG.debug('New    status    for    floating    IP    %(floatingip_id)s:    %(status)s', {'floatingip_id': floatingip_id, 'status': status})
            try:
                self.l3plugin.update_floatingip_status(context, floatingip_id, status)
            except l3.FloatingIPNotFound:
                LOG.debug('Floating    IP:    %s    no    longer    present.', floatingip_id)
        known_router_fips = self.l3plugin.get_floatingips(context, {'last_known_router_id': [router_id]})
        fips_to_disable = (fip['id'] for fip in known_router_fips if (not fip['router_id']))
        for fip_id in fips_to_disable:
            self.l3plugin.update_floatingip_status(context, fip_id, constants.FLOATINGIP_STATUS_DOWN)
