incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rg...@apache.org
Subject svn commit: r1028838 - in /incubator/tashi/trunk/src/zoni: extra/util.py install/db/zoniDbSetup.py install/pxe/zoniPxeSetup.py install/www/zoniWebSetup.py
Date Fri, 29 Oct 2010 16:57:07 GMT
Author: rgass
Date: Fri Oct 29 16:57:07 2010
New Revision: 1028838

URL: http://svn.apache.org/viewvc?rev=1028838&view=rev
Log:
reverting back to previous version of util to add the splits back in.  These were there to
allow inline comments in the config file.

Fixing files that use getConfig


Modified:
    incubator/tashi/trunk/src/zoni/extra/util.py
    incubator/tashi/trunk/src/zoni/install/db/zoniDbSetup.py
    incubator/tashi/trunk/src/zoni/install/pxe/zoniPxeSetup.py
    incubator/tashi/trunk/src/zoni/install/www/zoniWebSetup.py

Modified: incubator/tashi/trunk/src/zoni/extra/util.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/zoni/extra/util.py?rev=1028838&r1=1028837&r2=1028838&view=diff
==============================================================================
--- incubator/tashi/trunk/src/zoni/extra/util.py (original)
+++ incubator/tashi/trunk/src/zoni/extra/util.py Fri Oct 29 16:57:07 2010
@@ -29,50 +29,49 @@ def loadConfigFile(parser):
 	#parser.read(filename)
 	config = {}
 	#  Install dir
-	config['installBaseDir'] = parser.get("home", "INSTALL_BASE_DIR")
+	config['installBaseDir'] = parser.get("home", "INSTALL_BASE_DIR").split()[0]
 
 	#  Logging
-	#config['logFile'] = parser.get("logging", "LOG_FILE")
-	config['logFile'] = parser.get("logging", "LOG_FILE")
+	config['logFile'] = parser.get("logging", "LOG_FILE").split()[0]
 	
 	#  DB connection
-	config['dbUser'] = parser.get("dbConnection", "DB_USER")
+	config['dbUser'] = parser.get("dbConnection", "DB_USER").split()[0]
 	config['dbPassword'] = config.get("dbPassword", "")
 	if not parser.get("dbConnection", "DB_PASSWORD") == "":
 		config['dbPassword'] = parser.get("dbConnection", "DB_PASSWORD").strip("\",'")
-	config['dbHost'] = parser.get("dbConnection", "DB_HOST")
-	config['dbPort'] = int(parser.get("dbConnection", "DB_PORT"))
-	config['dbInst'] = parser.get("dbConnection", "DB_INST")
+	config['dbHost'] = parser.get("dbConnection", "DB_HOST").split()[0]
+	config['dbPort'] = int(parser.get("dbConnection", "DB_PORT").split()[0])
+	config['dbInst'] = parser.get("dbConnection", "DB_INST").split()[0]
 
 	#  PXE info
-	config['tftpRootDir'] = parser.get("pxe", "TFTP_ROOT_DIR")
-	config['tftpImageDir'] = parser.get("pxe", "TFTP_IMAGE_DIR")
-	config['tftpBootOptionsDir'] = parser.get("pxe", "TFTP_BOOT_OPTIONS_DIR")
-	config['tftpUpdateFile'] = parser.get("pxe", "TFTP_UPDATE_FILE")
-	config['tftpBaseFile'] = parser.get("pxe", "TFTP_BASE_FILE")
-	config['tftpBaseMenuFile'] = parser.get("pxe", "TFTP_BASE_MENU_FILE")
-	config['pxeServerIP'] = parser.get("pxe", "PXE_SERVER_IP")
-	config['initrdRoot'] = parser.get("pxe", "INITRD_ROOT")
+	config['tftpRootDir'] = parser.get("pxe", "TFTP_ROOT_DIR").split()[0]
+	config['tftpImageDir'] = parser.get("pxe", "TFTP_IMAGE_DIR").split()[0]
+	config['tftpBootOptionsDir'] = parser.get("pxe", "TFTP_BOOT_OPTIONS_DIR").split()[0]
+	config['tftpUpdateFile'] = parser.get("pxe", "TFTP_UPDATE_FILE").split()[0]
+	config['tftpBaseFile'] = parser.get("pxe", "TFTP_BASE_FILE").split()[0]
+	config['tftpBaseMenuFile'] = parser.get("pxe", "TFTP_BASE_MENU_FILE").split()[0]
+	config['pxeServerIP'] = parser.get("pxe", "PXE_SERVER_IP").split()[0]
+	config['initrdRoot'] = parser.get("pxe", "INITRD_ROOT").split()[0]
 
 	#  Image store
-	config['imageServerIP'] = parser.get("imageStore", "IMAGE_SERVER_IP")
-	config['fsImagesBaseDir'] = parser.get("imageStore", "FS_IMAGES_BASE_DIR")
+	config['imageServerIP'] = parser.get("imageStore", "IMAGE_SERVER_IP").split()[0]
+	config['fsImagesBaseDir'] = parser.get("imageStore", "FS_IMAGES_BASE_DIR").split()[0]
 
 	#  WWW
-	config['wwwDocumentRoot'] = parser.get("www", "WWW_DOCUMENT_ROOT")
-	config['registrationBaseDir'] = parser.get("www", "REGISTRATION_BASE_DIR")
+	config['wwwDocumentRoot'] = parser.get("www", "WWW_DOCUMENT_ROOT").split()[0]
+	config['registrationBaseDir'] = parser.get("www", "REGISTRATION_BASE_DIR").split()[0]
 	
 	#  SNMP
-	config['snmpCommunity'] = parser.get("snmp", "SNMP_COMMUNITY")
+	config['snmpCommunity'] = parser.get("snmp", "SNMP_COMMUNITY").split()[0]
 
 	#  VLAN
 	#config['vlan_reserved'] = parser.get("vlan", "VLAN_RESERVED")
 	config['vlan_max'] = parser.get("vlan", "VLAN_MAX")
 
 	#  Domain
-	config['zoniHomeDomain'] = parser.get("domain", "ZONI_HOME_DOMAIN")
-	config['zoniHomeNetwork'] = parser.get("domain", "ZONI_HOME_NETWORK")
-	config['zoniIpmiNetwork'] = parser.get("domain", "ZONI_IPMI_NETWORK")
+	config['zoniHomeDomain'] = parser.get("domain", "ZONI_HOME_DOMAIN").split()[0]
+	config['zoniHomeNetwork'] = parser.get("domain", "ZONI_HOME_NETWORK").split()[0]
+	config['zoniIpmiNetwork'] = parser.get("domain", "ZONI_IPMI_NETWORK").split()[0]
 	#config['vlan_max'] = parser.get("vlan", "VLAN_MAX")
 
 	#  HARDWARE CONTROL
@@ -89,7 +88,7 @@ def loadConfigFile(parser):
 	config['dhcpKeyName'] = parser.get("DhcpDns", "dhcpKeyName")
 	config['dhcpSecretKey'] = parser.get("DhcpDns", "dhcpSecretKey")
 
-	#self.ap_model['radius'] = int(parser.get("wireless_range", "radius"))
+	#self.ap_model['radius'] = int(parser.get("wireless_range", "radius").split()[0])
 	return config
 
 def getConfig(additionalNames=[], additionalFiles=[]):
@@ -104,9 +103,7 @@ def getConfig(additionalNames=[], additi
 	if (len(configFiles) == 0):
 		raise Exception("No config file could be found: %s" % (str(allLocations)))
 
-	return (loadConfigFile(config), configFiles) 
-
-
+	return (loadConfigFile(config), configFiles)
 
 def logit(logfile, mesg):
 	fd = open(logfile, "a+");

Modified: incubator/tashi/trunk/src/zoni/install/db/zoniDbSetup.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/zoni/install/db/zoniDbSetup.py?rev=1028838&r1=1028837&r2=1028838&view=diff
==============================================================================
--- incubator/tashi/trunk/src/zoni/install/db/zoniDbSetup.py (original)
+++ incubator/tashi/trunk/src/zoni/install/db/zoniDbSetup.py Fri Oct 29 16:57:07 2010
@@ -33,8 +33,9 @@ sys.path.append(a)
 a = os.path.join("../../..")
 sys.path.append(a)
 
-from zoni.extra.util import *
 from zoni.version import *
+from zoni.extra.util import *
+
 
 def main():
 	''' This file sets up the database for Zoni '''
@@ -57,9 +58,9 @@ def main():
 	if not options.password:
 		password = getpass.getpass()
 
-	configFile = getConfig()
+	(configs, configFiles) = getConfig()
 
-	CreateZoniDb(configFile, options.userName, password)
+	CreateZoniDb(configs, options.userName, password)
 
 
 def CreateZoniDb(config, adminUser, adminPassword):
@@ -344,7 +345,6 @@ def execQuery(conn, query):
 		sys.stdout.write("Fail\n")
 		msg = "ERROR: " + e[1]
 		sys.stderr.write(msg)
-		#logit(logFile, msg)
 		#traceback.print_exc(sys.exc_info())
 		exit()
 	return cursor

Modified: incubator/tashi/trunk/src/zoni/install/pxe/zoniPxeSetup.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/zoni/install/pxe/zoniPxeSetup.py?rev=1028838&r1=1028837&r2=1028838&view=diff
==============================================================================
--- incubator/tashi/trunk/src/zoni/install/pxe/zoniPxeSetup.py (original)
+++ incubator/tashi/trunk/src/zoni/install/pxe/zoniPxeSetup.py Fri Oct 29 16:57:07 2010
@@ -52,10 +52,10 @@ def main():
 	parser = optparse.OptionParser(usage="%prog ", version="%prog " + ver + " " + rev)
 	(options, args) = parser.parse_args()
 
-	configFile = getConfig()
+	(configs, configFile) = getConfig()
 
-	ZoniPxeSetup(configFile)
-	ZoniGetSyslinux(configFile)
+	ZoniPxeSetup(configs)
+	ZoniGetSyslinux(configs)
 
 
 def createDir(dirName):

Modified: incubator/tashi/trunk/src/zoni/install/www/zoniWebSetup.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/zoni/install/www/zoniWebSetup.py?rev=1028838&r1=1028837&r2=1028838&view=diff
==============================================================================
--- incubator/tashi/trunk/src/zoni/install/www/zoniWebSetup.py (original)
+++ incubator/tashi/trunk/src/zoni/install/www/zoniWebSetup.py Fri Oct 29 16:57:07 2010
@@ -50,10 +50,10 @@ def main():
 	parser = optparse.OptionParser(usage="%prog ", version="%prog " + ver + " " + rev)
 	(options, args) = parser.parse_args()
 
-	configFile = getConfig()
+	(configs, configFiles) = getConfig()
 
-	ZoniWebSetup(configFile)
-	ZoniCreateWebConfigFile(configFile)
+	ZoniWebSetup(configs)
+	ZoniCreateWebConfigFile(configs)
 
 
 def ZoniCreateWebConfigFile(config):



Mime
View raw message