'Returns a floating IP to the pool.'

@messaging.expected_exceptions(exception.FloatingIpNotFoundForAddress)
def deallocate_floating_ip(self, context, address, affect_auto_assigned=False):

    floating_ip = objects.FloatingIP.get_by_address(context, address)
    if ((not affect_auto_assigned) and floating_ip.auto_assigned):
        return
    self._floating_ip_owned_by_project(context, floating_ip)
    if floating_ip.fixed_ip_id:
        floating_address = floating_ip.address
        raise exception.FloatingIpAssociated(address=floating_address)
    self._delete_all_entries_for_ip(context, floating_ip.address)
    payload = dict(project_id=floating_ip.project_id, floating_ip=str(floating_ip.address))
    self.notifier.info(context, 'network.floating_ip.deallocate', payload)
    objects.FloatingIP.deallocate(context, address)
