You are viewing a plain text version of this content. The canonical link for it is here.
Posted to tashi-commits@incubator.apache.org by rg...@apache.org on 2011/11/03 15:15:09 UTC

svn commit: r1197176 - /incubator/tashi/trunk/src/tashi/agents/primitive.py

Author: rgass
Date: Thu Nov  3 15:15:09 2011
New Revision: 1197176

URL: http://svn.apache.org/viewvc?rev=1197176&view=rev
Log:
Fix problem with hooks not executing because VM was in destroying state.  Either we remove this check as it was before or make sure we check for all possible cases as stated in the comments above.



Modified:
    incubator/tashi/trunk/src/tashi/agents/primitive.py

Modified: incubator/tashi/trunk/src/tashi/agents/primitive.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/agents/primitive.py?rev=1197176&r1=1197175&r2=1197176&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/agents/primitive.py (original)
+++ incubator/tashi/trunk/src/tashi/agents/primitive.py Thu Nov  3 15:15:09 2011
@@ -235,17 +235,17 @@ class Primitive(object):
 		while True:
 			try:
 				self.__getState()
+				
 				# Check for VMs that have exited and call
 				# postDestroy hook
 				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):
+					if (i not in self.instances and (oldInstances[i].state == InstanceState.Running or oldInstances[i].state == InstanceState.Destroying)):
 						self.log.info("VM exited: %s" % (oldInstances[i].name))
 						for hook in self.hooks:
 							hook.postDestroy(oldInstances[i])
 
-
 				oldInstances = self.instances