def release_fixed_ip(self, context, address, mac=None):
        LOG.debug('Released IP |%s|', address, context=context)
        fixed_ip = objects.FixedIP.get_by_address(context, address)

        if fixed_ip.instance_uuid is None:
            LOG.warning(_LW('IP %s released that is not associated'), fixed_ip,
                        context=context)
            return
        if not fixed_ip.leased:
            LOG.warning(_LW('IP %s released that was not leased'), fixed_ip,
                        context=context, instance_uuid=fixed_ip.instance_uuid)
        else:
            fixed_ip.leased = False
            fixed_ip.save()
        if not fixed_ip.allocated:
            # NOTE(mriedem): Sometimes allocate_fixed_ip will associate the
            # fixed IP to a new instance while an old associated instance is
            # being deallocated. So we check to see if the mac is for the VIF
            # that is associated to the instance that is currently associated
            # with the fixed IP because if it's not, we hit this race and
            # should ignore the request so we don't disassociate the fixed IP
            # from the wrong instance.
            if mac:
                LOG.debug('Checking to see if virtual interface with MAC '
                          '%(mac)s is still associated to instance.',
                          {'mac': mac}, instance_uuid=fixed_ip.instance_uuid)
                vif = objects.VirtualInterface.get_by_address(context, mac)
                if vif:
                    LOG.debug('Found VIF: %s', vif,
                              instance_uuid=fixed_ip.instance_uuid)
                    if vif.instance_uuid != fixed_ip.instance_uuid:
                        LOG.info(_LI("Ignoring request to release fixed IP "
                                     "%(address)s with MAC %(mac)s since it "
                                     "is now associated with a new instance "
                                     "that is in the process of allocating "
                                     "it's network."),
                                 {'address': address, 'mac': mac},
                                 instance_uuid=fixed_ip.instance_uuid)
                        return
                else:
                    LOG.debug('No VIF was found for MAC: %s', mac,
                              instance_uuid=fixed_ip.instance_uuid)

            LOG.debug('Disassociating fixed IP %s from instance.', address,
                      instance_uuid=fixed_ip.instance_uuid)
            fixed_ip.disassociate()
Called by dhcp-bridge when IP is released.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/network/manager.py/NetworkManager.release_fixed_ip