incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1366270 - /incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py
Date Fri, 27 Jul 2012 04:16:49 GMT
Author: stroucki
Date: Fri Jul 27 04:16:48 2012
New Revision: 1366270

URL: http://svn.apache.org/viewvc?rev=1366270&view=rev
Log:
clustermanagerservice: start implementation for admin commands

Modified:
    incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.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=1366270&r1=1366269&r2=1366270&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py (original)
+++ incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py Fri Jul 27 04:16:48
2012
@@ -644,7 +644,84 @@ class ClusterManagerService(object):
 			self.log.exception('vmmSpecificCall failed on host %s with vmId %d' % (hostname, instance.vmId))
 			raise
 		return res
-	
+
+	def cmAdmin(self, args):
+
+		host = args.get("host")
+		hostname = args.get("hostname")
+
+		userid = args.get("userid")
+		username = args.get("username")
+
+		netid = args.get("netid")
+		netname = args.get("netname")
+
+		instanceId = args.get("instance")
+		statestr = args.get("state")
+
+		cmd = args.get("arg")
+		if cmd is None:
+			return
+
+		cmd = cmd.lower()
+
+		try:
+			if cmd == "addhost":
+				if hostname is None:
+					return "Specify hostname to add"
+
+				return "Not implemented yet"
+
+			elif cmd == "delhost":
+				if host is not None:
+					return "Not implemented yet"
+
+				if hostname is not None:
+					return "Not implemented yet"
+
+				return "Specify host to delete"
+
+			elif cmd == "adduser":
+				if username is None:
+					return "Specify username to add"
+
+				return "Not implemented yet"
+
+			elif cmd == "deluser":
+				if userid is not None:
+					return "Not implemented yet"
+
+				if username is not None:
+					return "Not implemented yet"
+
+				return "Specify user to delete"
+
+			elif cmd == "addnet":
+				if netid is None or \
+					    netname is None:
+					return "Specify net ID and name to add"
+
+				return "Not implemented yet"
+
+			elif cmd == "delnet":
+				if netid is not None:
+					return "Not implemented yet"
+
+				if netname is not None:
+					return "Not implemented yet"
+
+				return "Specify network to delete"
+
+			elif cmd == "setstate":
+				return "Not implemented yet"
+
+			else:
+				return "Unknown command"
+
+		except:
+			self.log.exception('cmAdmin failed')
+			raise
+
 	# extern
 	def registerNodeManager(self, host, instances):
 		"""Called by the NM every so often as a keep-alive/state polling -- state changes here
are NOT AUTHORITATIVE"""



Mime
View raw message