def _wait_for_destroy(expected_domid):
    'Called at an interval until the VM is gone.'
    try:
        dom_info = self.get_info(instance)
        state = dom_info['state']
        new_domid = dom_info['id']
    except exception.InstanceNotFound:
        LOG.warning(_LW('During wait destroy, instance disappeared.'), instance=instance)
        raise loopingcall.LoopingCallDone()
    if (state == power_state.SHUTDOWN):
        LOG.info(_LI('Instance destroyed successfully.'), instance=instance)
        raise loopingcall.LoopingCallDone()
    if (new_domid != expected_domid):
        LOG.info(_LI('Instance may be started again.'), instance=instance)
        kwargs['is_running'] = True
        raise loopingcall.LoopingCallDone()
Called at an interval until the VM is gone.
def _wait_for_destroy(expected_domid):
    
    try:
        dom_info = self.get_info(instance)
        state = dom_info['state']
        new_domid = dom_info['id']
    except exception.InstanceNotFound:
        LOG.warning(_LW('During wait destroy, instance disappeared.'), instance=instance)
        raise loopingcall.LoopingCallDone()
    if (state == power_state.SHUTDOWN):
        LOG.info(_LI('Instance destroyed successfully.'), instance=instance)
        raise loopingcall.LoopingCallDone()
    if (new_domid != expected_domid):
        LOG.info(_LI('Instance may be started again.'), instance=instance)
        kwargs['is_running'] = True
        raise loopingcall.LoopingCallDone()