Add comment to instance_destroy()

The instance_actions and instance_actions_events tables are handled
differently than most when we soft-delete an instance.

It's not immediately obvious why this is, so let's add a comment
explaining what's going on.

Change-Id: Ie353650861c2911e4f55628c55f049fc1756e591
This commit is contained in:
Chris Friesen 2017-03-03 14:26:48 -06:00
parent ded8170d0e
commit f1cf1de00f
1 changed files with 5 additions and 0 deletions

View File

@ -1885,6 +1885,11 @@ def instance_destroy(context, instance_uuid, constraint=None):
resource_id=instance_uuid).delete()
context.session.query(models.ConsoleAuthToken).filter_by(
instance_uuid=instance_uuid).delete()
# NOTE(cfriesen): We intentionally do not soft-delete entries in the
# instance_actions or instance_actions_events tables because they
# can be used by operators to find out what actions were performed on a
# deleted instance. Both of these tables are special-cased in
# _archive_deleted_rows_for_table().
return instance_ref