incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1304645 - in /incubator/tashi/trunk: etc/TashiDefaults.cfg src/tashi/client/tashi-client.py src/tashi/clustermanager/clustermanager.py src/tashi/clustermanager/clustermanagerservice.py
Date Fri, 23 Mar 2012 22:56:37 GMT
Author: stroucki
Date: Fri Mar 23 22:56:37 2012
New Revision: 1304645

URL: http://svn.apache.org/viewvc?rev=1304645&view=rev
Log:
Support configurable default network. Fixes TASHI-16.

Modified:
    incubator/tashi/trunk/etc/TashiDefaults.cfg
    incubator/tashi/trunk/src/tashi/client/tashi-client.py
    incubator/tashi/trunk/src/tashi/clustermanager/clustermanager.py
    incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py

Modified: incubator/tashi/trunk/etc/TashiDefaults.cfg
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/etc/TashiDefaults.cfg?rev=1304645&r1=1304644&r2=1304645&view=diff
==============================================================================
--- incubator/tashi/trunk/etc/TashiDefaults.cfg (original)
+++ incubator/tashi/trunk/etc/TashiDefaults.cfg Fri Mar 23 22:56:37 2012
@@ -54,6 +54,7 @@ allowDecayed = 30.0
 allowMismatchedVersions = False
 maxMemory = 8192
 maxCores = 8
+defaultNetwork = 0
 allowDuplicateNames = False
 ;accountingHost = clustermanager
 ;accountingPort = 2228

Modified: incubator/tashi/trunk/src/tashi/client/tashi-client.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/client/tashi-client.py?rev=1304645&r1=1304644&r2=1304645&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/client/tashi-client.py (original)
+++ incubator/tashi/trunk/src/tashi/client/tashi-client.py Fri Mar 23 22:56:37 2012
@@ -80,7 +80,7 @@ def getDefaultNetwork():
 	fetchNetworks()
 	networkId = 1
 	for network in networks:
-		if (networks[network].name == "default"):
+		if (getattr(networks[network], "default", False) is True):
 			networkId = network
 	return networkId
 

Modified: incubator/tashi/trunk/src/tashi/clustermanager/clustermanager.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/clustermanager/clustermanager.py?rev=1304645&r1=1304644&r2=1304645&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/clustermanager/clustermanager.py (original)
+++ incubator/tashi/trunk/src/tashi/clustermanager/clustermanager.py Fri Mar 23 22:56:37 2012
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file

Modified: incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py?rev=1304645&r1=1304644&r2=1304645&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py (original)
+++ incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py Fri Mar 23 22:56:37
2012
@@ -49,6 +49,13 @@ class ClusterManagerService(object):
 		self.allowMismatchedVersions = boolean(self.config.get('ClusterManagerService', 'allowMismatchedVersions'))
 		self.maxMemory = int(self.config.get('ClusterManagerService', 'maxMemory'))
 		self.maxCores = int(self.config.get('ClusterManagerService', 'maxCores'))
+
+		self.defaultNetwork = 0
+		try:
+			self.defaultNetwork = int(self.config.get('ClusterManagerService', 'defaultNetwork'))
+		except:
+			pass
+
 		self.allowDuplicateNames = boolean(self.config.get('ClusterManagerService', 'allowDuplicateNames'))
 
 		self.accountingHost = None
@@ -538,7 +545,12 @@ class ClusterManagerService(object):
 		return self.data.getHosts().values()
 	
 	def getNetworks(self):
-		return self.data.getNetworks().values()
+		networks = self.data.getNetworks()
+		if self.defaultNetwork in networks:
+			setattr(networks[self.defaultNetwork], "default", True)
+
+		return networks.values()
+
 	
 	def getUsers(self):
 		return self.data.getUsers().values()



Mime
View raw message