# FIXME(comstud): See bug 1296414. Quotas here should only be
# committed if the instance is not SOFT_DELETED. If there were
# some sort of race and the instance was SOFT_DELETED, we should
# not commit quotas, as they would have already been done in
# soft_delete().
I think we are not able to enter into this condition because _complete_deletion was called by _complete_partial_deletion and
_delete_instance
only if the instance state is DELETED you can enter _complete_partial_deletion
if we can call _complete_deletion in _delete_instance, that means instance state already become DELETED
(instance.vm_state = vm_states.DELETED)
also, if the _delete_instance was called with instance state SOFT_DELETED, the quotas.rollback() will be called
it will lead quotas.commit later take no effect since the quotas.reservations is already None
some discussion topics:
comments in _complete_deletion
# FIXME(comstud): See bug 1296414. Quotas here should only be
# committed if the instance is not SOFT_DELETED. If there were
# some sort of race and the instance was SOFT_DELETED, we should
# not commit quotas, as they would have already been done in
# soft_delete().
I think we are not able to enter into this condition because _complete_deletion was called by _complete_ partial_ deletion and
_delete_instance
only if the instance state is DELETED you can enter _complete_ partial_ deletion
if we can call _complete_deletion in _delete_instance, that means instance state already become DELETED
(instance.vm_state = vm_states.DELETED)
also, if the _delete_instance was called with instance state SOFT_DELETED, the quotas.rollback() will be called
it will lead quotas.commit later take no effect since the quotas.reservations is already None
so I think it's not a problem