incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mry...@apache.org
Subject svn commit: r763809 - in /incubator/tashi/trunk/src/tashi: clustermanager/clustermanagerservice.py nodemanager/nodemanagerservice.py util.py
Date Thu, 09 Apr 2009 21:18:40 GMT
Author: mryan3
Date: Thu Apr  9 21:18:39 2009
New Revision: 763809

URL: http://svn.apache.org/viewvc?rev=763809&view=rev
Log:
Cleaned up some older crufty code


Modified:
    incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py
    incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py
    incubator/tashi/trunk/src/tashi/util.py

Modified: incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py?rev=763809&r1=763808&r2=763809&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py (original)
+++ incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py Thu Apr  9 21:18:39
2009
@@ -281,7 +281,6 @@
 		except Exception, e:
 			self.log.exception('receiveVm failed')
 			raise
-		#print 'VM %i Migrated!  New vmId=%i, new hostId=%i' % (instance.id, vmId, targetHostId)
 		return
 	
 	@RPC

Modified: incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py?rev=763809&r1=763808&r2=763809&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py (original)
+++ incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py Thu Apr  9 21:18:39
2009
@@ -58,7 +58,7 @@
 			if (vmId not in vmList):
 				self.log.warning('vmcontrol backend does not report %d' % (vmId))
 				self.vmStateChange(vmId, None, InstanceState.Exited)
-		threading.Thread(target=self.junk).start()
+		threading.Thread(target=self.backupVmInfoAndFlushNotifyCM).start()
 		threading.Thread(target=self.registerWithClusterManager).start()
 	
 	def loadVmInfo(self):
@@ -80,7 +80,6 @@
 		except Exception, e:
 			self.log.exception('Failed to save VM info to %s' % (self.infoFile))
 	
-	#@logged
 	def vmStateChange(self, vmId, old, cur):
 		cm = ConnectionManager(clustermanagerservice.Client, self.cmPort)[self.cmHost]
 		instance = self.getInstance(vmId)
@@ -100,7 +99,6 @@
 			success()
 		return True
 	
-	#@timed	
 	def getHostInfo(self):
 		host = Host()
 		host.id = self.id
@@ -123,7 +121,7 @@
 		host.version = version
 		return host
 	
-	def junk(self):
+	def backupVmInfoAndFlushNotifyCM(self):
 		cm = ConnectionManager(clustermanagerservice.Client, self.cmPort)[self.cmHost]
 		while True:
 			start = time.time()
@@ -157,21 +155,14 @@
 	
 	def registerWithClusterManager(self):
 		cm = ConnectionManager(clustermanagerservice.Client, self.cmPort)[self.cmHost]
-		#@timed
-		def body():
+		while True:
+			start = time.time()
 			try:
-				#self.log.info('registering with CM at %f' % (time.time()))
 				host = self.getHostInfo()
 				instances = self.instances.values()
-				#@timed
-				def RPC(self):
-					self.id = cm.registerNodeManager(host, instances)
-				RPC(self)
+				self.id = cm.registerNodeManager(host, instances)
 			except Exception, e:
 				self.log.exception('Failed to register with the CM')
-		while True:
-			start = time.time()
-			body()
 			toSleep = start - time.time() + self.registerFrequency
 			if (toSleep > 0):
 				time.sleep(toSleep)

Modified: incubator/tashi/trunk/src/tashi/util.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/util.py?rev=763809&r1=763808&r2=763809&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/util.py (original)
+++ incubator/tashi/trunk/src/tashi/util.py Thu Apr  9 21:18:39 2009
@@ -242,7 +242,7 @@
 				try:
 					exec(input) in globalDict
 				except Exception, e:
-					print e
+					sys.stdout.write(str(e) + "\n")
 	if (os.getenv("DEBUG", "0") == "1"):
 		threading.Thread(target=lambda: realDebugConsole(globalDict)).start()
 



Mime
View raw message