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/09/28 23:19:41 UTC

svn commit: r1177104 - in /incubator/tashi/branches/zoni-dev/trunk: etc/TashiDefaults.cfg src/tashi/agents/dhcpdns.py src/tashi/clustermanager/clustermanager.py src/tashi/nodemanager/nodemanager.py

Author: rgass
Date: Wed Sep 28 23:19:41 2011
New Revision: 1177104

URL: http://svn.apache.org/viewvc?rev=1177104&view=rev
Log:
Removing dnsKeyFile from config and dhcpdns and adding dnsSecretKey and dnsKeyName

adding a try to test for new TlsliteVdbAuthenticator import and call with new version of rpyc


Modified:
    incubator/tashi/branches/zoni-dev/trunk/etc/TashiDefaults.cfg
    incubator/tashi/branches/zoni-dev/trunk/src/tashi/agents/dhcpdns.py
    incubator/tashi/branches/zoni-dev/trunk/src/tashi/clustermanager/clustermanager.py
    incubator/tashi/branches/zoni-dev/trunk/src/tashi/nodemanager/nodemanager.py

Modified: incubator/tashi/branches/zoni-dev/trunk/etc/TashiDefaults.cfg
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/zoni-dev/trunk/etc/TashiDefaults.cfg?rev=1177104&r1=1177103&r2=1177104&view=diff
==============================================================================
--- incubator/tashi/branches/zoni-dev/trunk/etc/TashiDefaults.cfg (original)
+++ incubator/tashi/branches/zoni-dev/trunk/etc/TashiDefaults.cfg Wed Sep 28 23:19:41 2011
@@ -159,7 +159,8 @@ defaultJobTime = 8640000000
 
 [DhcpDns]
 dnsEnabled = True
-dnsKeyFile = /location/of/private/key/for/dns
+dnsSecretKey = ABcdEf12GhIJKLmnOpQrsT==
+dnsKeyName = name_of_dns_key_hostname
 dnsServer = 1.2.3.4 53
 dnsDomain = tashi.example.com
 dnsExpire = 300
@@ -168,6 +169,7 @@ dhcpServer = 1.2.3.4
 # Host key name
 dhcpKeyName = OMAPI
 dhcpSecretKey = ABcdEf12GhIJKLmnOpQrsT==
+#  ipRangeX - where X is the vlan number 
 ipRange1 = 172.16.128.2-172.16.255.254
 reverseDns = True
 # Clustermanager hostname

Modified: incubator/tashi/branches/zoni-dev/trunk/src/tashi/agents/dhcpdns.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/zoni-dev/trunk/src/tashi/agents/dhcpdns.py?rev=1177104&r1=1177103&r2=1177104&view=diff
==============================================================================
--- incubator/tashi/branches/zoni-dev/trunk/src/tashi/agents/dhcpdns.py (original)
+++ incubator/tashi/branches/zoni-dev/trunk/src/tashi/agents/dhcpdns.py Wed Sep 28 23:19:41 2011
@@ -28,7 +28,8 @@ from tashi import boolean
 class DhcpDns(InstanceHook):
 	def __init__(self, config, client, post=False):
 		InstanceHook.__init__(self, config, client, post)
-		self.dnsKeyFile = self.config.get('DhcpDns', 'dnsKeyFile')
+		self.dnsKeyName = self.config.get('DhcpDns', 'dnsKeyName')
+		self.dnsSecretKey = self.config.get('DhcpDns', 'dnsSecretKey')
 		self.dnsServer = self.config.get('DhcpDns', 'dnsServer')
 		self.dnsDomain = self.config.get('DhcpDns', 'dnsDomain')
 		self.dnsExpire = int(self.config.get('DhcpDns', 'dnsExpire'))
@@ -153,14 +154,12 @@ class DhcpDns(InstanceHook):
 			self.removeDns(name)
 		except:
 			pass
-		if (self.dnsKeyFile != ""):
-			cmd = "nsupdate -k %s" % (self.dnsKeyFile)
-		else:
-			cmd = "nsupdate"
+		cmd = "nsupdate"
 		child = subprocess.Popen(args=cmd.split(), stdin=subprocess.PIPE, stdout=subprocess.PIPE)
 		try:
 			(stdin, stdout) = (child.stdin, child.stdout)
 			stdin.write("server %s\n" % (self.dnsServer))
+			stdin.write("key %s %s\n" % (self.dnsKeyName, self.dnsSecretKey))
 			stdin.write("update add %s.%s %d A %s\n" % (name, self.dnsDomain, self.dnsExpire, ip))
 			stdin.write("\n")
 			if (self.reverseDns):
@@ -181,14 +180,12 @@ class DhcpDns(InstanceHook):
 				(pid, status) = os.waitpid(child.pid, os.WNOHANG)
 	
 	def removeDns(self, name):
-		if (self.dnsKeyFile != ""):
-			cmd = "nsupdate -k %s" % (self.dnsKeyFile)
-		else:
-			cmd = "nsupdate"
+		cmd = "nsupdate"
 		child = subprocess.Popen(args=cmd.split(), stdin=subprocess.PIPE, stdout=subprocess.PIPE)
 		try:
 			(stdin, stdout) = (child.stdin, child.stdout)
 			stdin.write("server %s\n" % (self.dnsServer))
+			stdin.write("key %s %s\n" % (self.dnsKeyName, self.dnsSecretKey))
 			if (self.reverseDns):
 				ip = socket.gethostbyname(name)
 				ipSegments = map(int, ip.split("."))

Modified: incubator/tashi/branches/zoni-dev/trunk/src/tashi/clustermanager/clustermanager.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/zoni-dev/trunk/src/tashi/clustermanager/clustermanager.py?rev=1177104&r1=1177103&r2=1177104&view=diff
==============================================================================
--- incubator/tashi/branches/zoni-dev/trunk/src/tashi/clustermanager/clustermanager.py (original)
+++ incubator/tashi/branches/zoni-dev/trunk/src/tashi/clustermanager/clustermanager.py Wed Sep 28 23:19:41 2011
@@ -30,7 +30,10 @@ import tashi
 
 from tashi.rpycservices import rpycservices
 from rpyc.utils.server import ThreadedServer
-from rpyc.utils.authenticators import VdbAuthenticator
+try:
+	from rpyc.utils.authenticators import VdbAuthenticator
+except:
+	from rpyc.utils.authenticators import TlsliteVdbAuthenticator
 
 def startClusterManager(config):
 	global service, data
@@ -47,7 +50,10 @@ def startClusterManager(config):
 				users[user.name] = user.passwd
 		users[config.get('AllowedUsers', 'nodeManagerUser')] = config.get('AllowedUsers', 'nodeManagerPassword')
 		users[config.get('AllowedUsers', 'agentUser')] = config.get('AllowedUsers', 'agentPassword')
-		authenticator = VdbAuthenticator.from_dict(users)
+		try:
+			authenticator = VdbAuthenticator.from_dict(users)
+		except:
+			authenticator = TlsliteVdbAuthenticator.from_dict(users)
 		t = ThreadedServer(service=rpycservices.ManagerService, hostname='0.0.0.0', port=int(config.get('ClusterManagerService', 'port')), auto_register=False, authenticator=authenticator)
 	else:
 		t = ThreadedServer(service=rpycservices.ManagerService, hostname='0.0.0.0', port=int(config.get('ClusterManagerService', 'port')), auto_register=False)

Modified: incubator/tashi/branches/zoni-dev/trunk/src/tashi/nodemanager/nodemanager.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/zoni-dev/trunk/src/tashi/nodemanager/nodemanager.py?rev=1177104&r1=1177103&r2=1177104&view=diff
==============================================================================
--- incubator/tashi/branches/zoni-dev/trunk/src/tashi/nodemanager/nodemanager.py (original)
+++ incubator/tashi/branches/zoni-dev/trunk/src/tashi/nodemanager/nodemanager.py Wed Sep 28 23:19:41 2011
@@ -28,7 +28,10 @@ from tashi import boolean
 
 from tashi.rpycservices import rpycservices
 from rpyc.utils.server import ThreadedServer
-from rpyc.utils.authenticators import VdbAuthenticator
+try:
+	from rpyc.utils.authenticators import VdbAuthenticator
+except:
+	from rpyc.utils.authenticators import TlsliteVdbAuthenticator
 
 @signalHandler(signal.SIGTERM)
 def handleSIGTERM(signalNumber, stackFrame):
@@ -51,7 +54,10 @@ def main():
 	if boolean(config.get("Security", "authAndEncrypt")):
 		users = {}
 		users[config.get('AllowedUsers', 'clusterManagerUser')] = config.get('AllowedUsers', 'clusterManagerPassword')
-		authenticator = VdbAuthenticator.from_dict(users)
+		try:
+			authenticator = VdbAuthenticator.from_dict(users)
+		except:
+			authenticator = TlsliteVdbAuthenticator.from_dict(users)
 		t = ThreadedServer(service=rpycservices.ManagerService, hostname='0.0.0.0', port=int(config.get('NodeManagerService', 'port')), auto_register=False, authenticator=authenticator)
 	else:
 		t = ThreadedServer(service=rpycservices.ManagerService, hostname='0.0.0.0', port=int(config.get('NodeManagerService', 'port')), auto_register=False)