summaryrefslogtreecommitdiff
path: root/nova/notifications.py
diff options
context:
space:
mode:
authorPhil Day <philip.day@hp.com>2013-09-20 11:38:21 +0000
committerPhil Day <philip.day@hp.com>2013-09-20 13:30:24 +0000
commit268a7d4e68a567aaeda93c4e828c34701390d7f2 (patch)
tree62097d90ac11c865a32528c6bb2b4279d23c5c11 /nova/notifications.py
parentb4661db66e31b294a0187a9a0728cc1f520a0bbc (diff)
downloadnova-268a7d4e68a567aaeda93c4e828c34701390d7f2.tar.gz
Correct deleted_at value in notification messages
The deleted_at value in notification messages is currently set from the terminated_at value in the instance record. A comment in the code says this is to avoid confusion between terminated_at and deleted_at, but swapping the names doesn't seem to be a great way to address that. In practice "terminated and not deleted" is a transient state unless an error occurs, and the time gap is very short. But deleted_at is always set when the entry is deleted in the DB, whereas terminated_at can be left unset in some error cases. Rather than present terminated_at as the deleted_at value in the message we include both and let the recipient decide which they want to use. Fixes bug: 1227080 Change-Id: Ic67f66b6c64be1a8f43f4fdd5b1fac25f1414247
Diffstat (limited to 'nova/notifications.py')
-rw-r--r--nova/notifications.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/nova/notifications.py b/nova/notifications.py
index 3c50606bcc..57c6edd03b 100644
--- a/nova/notifications.py
+++ b/nova/notifications.py
@@ -381,10 +381,11 @@ def info_from_instance(context, instance_ref, network_info,
# Date properties
created_at=str(instance_ref['created_at']),
- # Nova's deleted vs terminated instance terminology is confusing,
- # this should be when the instance was deleted (i.e. terminated_at),
- # not when the db record was deleted. (mdragon)
- deleted_at=null_safe_isotime(instance_ref.get('terminated_at')),
+ # Terminated and Deleted are slightly different (although being
+ # terminated and not deleted is a transient state), so include
+ # both and let the recipient decide which they want to use.
+ terminated_at=null_safe_isotime(instance_ref.get('terminated_at')),
+ deleted_at=null_safe_isotime(instance_ref.get('deleted_at')),
launched_at=null_safe_isotime(instance_ref.get('launched_at')),
# Image properties