primitive: let primitive notice shutdowns too. The code for this should be rewritten.
git-svn-id: https://svn.apache.org/repos/asf/incubator/tashi/trunk@1297148 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/tashi/agents/primitive.py b/src/tashi/agents/primitive.py
index cc81639..2e70ec9 100755
--- a/src/tashi/agents/primitive.py
+++ b/src/tashi/agents/primitive.py
@@ -251,7 +251,7 @@
for i in oldInstances:
# XXXstroucki what about paused and saved VMs?
# XXXstroucki: do we need to look at Held VMs here?
- if (i not in self.instances and (oldInstances[i].state == InstanceState.Running or oldInstances[i].state == InstanceState.Destroying)):
+ if (i not in self.instances and (oldInstances[i].state == InstanceState.Running or oldInstances[i].state == InstanceState.Destroying or oldInstances[i].state == InstanceState.ShuttingDown)):
self.log.info("VM exited: %s" % (oldInstances[i].name))
for hook in self.hooks:
hook.postDestroy(oldInstances[i])