incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1298112 - in /incubator/tashi/branches/stroucki-stable: ./ INSTALL src/tashi/client/tashi-client.py src/tashi/clustermanager/data/getentoverride.py src/tashi/nodemanager/nodemanagerservice.py src/tashi/util.py
Date Wed, 07 Mar 2012 20:58:36 GMT
Author: stroucki
Date: Wed Mar  7 20:58:36 2012
New Revision: 1298112

URL: http://svn.apache.org/viewvc?rev=1298112&view=rev
Log:
merge from trunk.
util.py: yuck, they changed the calling type for embedded ipython. also ensure we exit after
leaving debug shell 

Modified:
    incubator/tashi/branches/stroucki-stable/   (props changed)
    incubator/tashi/branches/stroucki-stable/INSTALL
    incubator/tashi/branches/stroucki-stable/src/tashi/client/tashi-client.py
    incubator/tashi/branches/stroucki-stable/src/tashi/clustermanager/data/getentoverride.py
    incubator/tashi/branches/stroucki-stable/src/tashi/nodemanager/nodemanagerservice.py
    incubator/tashi/branches/stroucki-stable/src/tashi/util.py

Propchange: incubator/tashi/branches/stroucki-stable/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Mar  7 20:58:36 2012
@@ -11,3 +11,4 @@
 /incubator/tashi/branches/stroucki-tashi2:1294935-1294944
 /incubator/tashi/branches/stroucki-tashi8:1294393-1294427
 /incubator/tashi/branches/zoni-dev/trunk:1034098-1177646
+/incubator/tashi/trunk:1297792-1298109

Modified: incubator/tashi/branches/stroucki-stable/INSTALL
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-stable/INSTALL?rev=1298112&r1=1298111&r2=1298112&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-stable/INSTALL (original)
+++ incubator/tashi/branches/stroucki-stable/INSTALL Wed Mar  7 20:58:36 2012
@@ -124,6 +124,7 @@ When defining the host, you must provide
 given by the hostname command. If you plan on eventually having several 
 hosts and networks, feel free to add them now.
 
+root@grml:/usr/local/tashi# cd bin
 root@grml:/usr/local/tashi/bin# DEBUG=1 ./clustermanager
 2012-01-26 23:12:33,972 [./clustermanager:INFO] Using configuration file(s) ['/usr/local/tashi/etc/TashiDefaults.cfg']
 2012-01-26 23:12:33,972 [./clustermanager:INFO] Starting cluster manager
@@ -158,9 +159,8 @@ In [3]: data.baseDataObject.networks[1]=
 
 In [4]: data.baseDataObject.save()
 
-In [5]: import os
-
-In [6]: os.kill(os.getpid(), 9)
+In [5]: (^C)
+2012-03-07 20:00:00,456 [./bin/clustermanager:INFO] Exiting cluster manager after receiving
a SIGINT signal
 
 Run the cluster manager in the background:
 root@grml:/usr/local/tashi/bin# ./clustermanager &

Modified: incubator/tashi/branches/stroucki-stable/src/tashi/client/tashi-client.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-stable/src/tashi/client/tashi-client.py?rev=1298112&r1=1298111&r2=1298112&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-stable/src/tashi/client/tashi-client.py (original)
+++ incubator/tashi/branches/stroucki-stable/src/tashi/client/tashi-client.py Wed Mar  7 20:58:36
2012
@@ -340,7 +340,8 @@ def usage(func = None):
 			print "Unknown function %s" % (func)
 			print
 		functions = argLists
-		print "%s is the client program for Tashi, a system for cloud-computing on BigData." %
(os.path.basename(sys.argv[0]))
+		print "%s is the client program for Tashi" % (os.path.basename(sys.argv[0]))
+		print "Tashi, a system for cloud-computing on BigData"
 		print "Visit http://incubator.apache.org/tashi/ for more information."
 		print
 	else:

Modified: incubator/tashi/branches/stroucki-stable/src/tashi/clustermanager/data/getentoverride.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-stable/src/tashi/clustermanager/data/getentoverride.py?rev=1298112&r1=1298111&r2=1298112&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-stable/src/tashi/clustermanager/data/getentoverride.py
(original)
+++ incubator/tashi/branches/stroucki-stable/src/tashi/clustermanager/data/getentoverride.py
Wed Mar  7 20:58:36 2012
@@ -19,7 +19,7 @@ import logging
 import subprocess
 import time
 import os
-from tashi.rpycservices.rpyctypes import User, LocalImages
+from tashi.rpycservices.rpyctypes import User, LocalImages, Instance, Host
 from tashi.clustermanager.data import DataInterface
 from tashi.util import instantiateImplementation, humanReadable
 
@@ -66,7 +66,7 @@ class GetentOverride(DataInterface):
 		return self.baseDataObject.acquireHost(hostId)
 	
 	def releaseHost(self, host):
-		if type(host) is not Instance:
+		if type(host) is not Host:
 			self.log.exception("Argument is not of type Host, but of type %s" % (type(host)))
 			raise TypeError
 

Modified: incubator/tashi/branches/stroucki-stable/src/tashi/nodemanager/nodemanagerservice.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-stable/src/tashi/nodemanager/nodemanagerservice.py?rev=1298112&r1=1298111&r2=1298112&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-stable/src/tashi/nodemanager/nodemanagerservice.py (original)
+++ incubator/tashi/branches/stroucki-stable/src/tashi/nodemanager/nodemanagerservice.py Wed
Mar  7 20:58:36 2012
@@ -76,6 +76,8 @@ class NodeManagerService(object):
 
 		self.__registerHost()
 
+		# XXXstroucki: should make an effort to retry
+		# otherwise vmm will wait forever
 		self.id = self.cm.registerNodeManager(self.host, self.instances.values())
 
 		# XXXstroucki cut cross check for NM/VMM state

Modified: incubator/tashi/branches/stroucki-stable/src/tashi/util.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-stable/src/tashi/util.py?rev=1298112&r1=1298111&r2=1298112&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-stable/src/tashi/util.py (original)
+++ incubator/tashi/branches/stroucki-stable/src/tashi/util.py Wed Mar  7 20:58:36 2012
@@ -211,28 +211,32 @@ def getConfig(additionalNames=[], additi
 		raise Exception("No config file could be found: %s" % (str(allLocations)))
 	return (config, configFiles)
 
-def __getShellFn(globalDict):
-	if sys.version_info < (2, 6, 1):
+def __getShellFn():
+	try:
 		from IPython.Shell import IPShellEmbed
-		return IPShellEmbed(user_ns=globalDict)
-	else:
+		return (1, IPShellEmbed)
+	except ImportError:
 		import IPython
-		return IPython.embed(user_ns=globalDict)
+		return (2, IPython.embed)
 
 def debugConsole(globalDict):
 	"""A debugging console that optionally uses pysh"""
 	def realDebugConsole(globalDict):
 		try :
 			import atexit
-			shellfn = __getShellFn(globalDict)
+			(calltype, shellfn) = __getShellFn()
 			def resetConsole():
 # XXXpipe: make input window sane
 				(stdin, stdout) = os.popen2("reset")
 				stdout.read()
-			dbgshell = shellfn()
 			atexit.register(resetConsole)
-			dbgshell()
-		except Exception:
+			if calltype == 1:
+				dbgshell=shellfn(user_ns=globalDict)
+				dbgshell()
+			elif calltype == 2:
+				dbgshell=shellfn
+				dbgshell(user_ns=globalDict)
+		except Exception, e:
 			CONSOLE_TEXT=">>> "
 			input = " " 
 			while (input != ""):
@@ -242,6 +246,10 @@ def debugConsole(globalDict):
 					exec(input) in globalDict
 				except Exception, e:
 					sys.stdout.write(str(e) + "\n")
+
+		import os
+		os._exit(0)
+
 	if (os.getenv("DEBUG", "0") == "1"):
 		threading.Thread(target=lambda: realDebugConsole(globalDict)).start()
 



Mime
View raw message