Skip to contentSkip to conversation

conga/luci/site/luci/Extensions HelperFunction ...

Cluster-devel [email protected] 1 participant 1 message Sep 24, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2007-09-24 21:19:43

Modified files:
luci/site/luci/Extensions: HelperFunctions.py LuciZopeAsync.py
PropsObject.py ResourceHandler.py StorageReport.py Variable.py conga_constants.py conga_ssl.py conga_storage_constants.py ricci_communicator.py ricci_defines.py storage_adapters.py

Log message:
More cleanup.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/HelperFunctions.py.diff?cvsroot=cluster&r1=1.9&r2=1.10
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZopeAsync.py.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/PropsObject.py.diff?cvsroot=cluster&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ResourceHandler.py.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/StorageReport.py.diff?cvsroot=cluster&r1=1.27&r2=1.28
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/Variable.py.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_constants.py.diff?cvsroot=cluster&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_ssl.py.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_storage_constants.py.diff?cvsroot=cluster&r1=1.9&r2=1.10
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_communicator.py.diff?cvsroot=cluster&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_defines.py.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/storage_adapters.py.diff?cvsroot=cluster&r1=1.12&r2=1.13

luci/site/luci/Extensions/HelperFunctions.py +2 -2
@@ -79,8 +79,8 @@
 
 def get_system_info(self, system_list):
 	mutex = threading.RLock()
-	hive  = [] # workers
-	ss	= {} # storage systems (will store riccis and then use them to retrieve real info)
+	hive = [] # workers
+	ss = {} # storage systems (will store riccis and then use them to retrieve real info)
 	hosts = [] # hostnames
 
 	for system in system_list:
luci/site/luci/Extensions/LuciZopeAsync.py +1 -1
@@ -38,7 +38,7 @@
 					pyobj_to_xml(i, element[i], xml_elem)
 			else:
 				xml_elem = None
-		elif type(element) in [ types.ListType, types.TupleType ]:
+		elif type(element) in ( types.ListType, types.TupleType ):
 			if len(element) > 0:
 				xml_elem = root.createElement('list')
 				xml_elem.setAttribute('name', str(element_name))
luci/site/luci/Extensions/PropsObject.py +37 -36

78 lines not on this page · raw message

luci/site/luci/Extensions/ResourceHandler.py +3 -3
@@ -684,7 +684,7 @@
 
 	try:
 		dbtype = form['DBTYPE'].strip()
-		if not dbtype in [ 'ORA', 'DB6', 'ADA' ]:
+		if not dbtype in ( 'ORA', 'DB6', 'ADA' ):
 			raise Exception, 'You gave an invalid database type: %s' % dbtype
 		res.addAttribute('DBTYPE', dbtype)
 	except Exception, e:
@@ -699,7 +699,7 @@
 		res.removeAttribute('DBJ2EE_ONLY')
 
 	# Optional string parameters
-	for param in [ 'DIR_EXECUTABLE', 'NETSERVICENAME', 'DIR_BOOTSTRAP', 'DIR_SECSTORE' ]:
+	for param in ( 'DIR_EXECUTABLE', 'NETSERVICENAME', 'DIR_BOOTSTRAP', 'DIR_SECSTORE' ):
 		try:
 			pval = form[param].strip()
 			if not pval:
@@ -721,7 +721,7 @@
 	res.addAttribute('InstanceName', rname)
 
 	# Optional string parameters
-	for param in [ 'DIR_EXECUTABLE', 'DIR_PROFILE', 'START_PROFILE' ]:
+	for param in ( 'DIR_EXECUTABLE', 'DIR_PROFILE', 'START_PROFILE' ):
 		try:
 			pval = form[param].strip()
 			if not pval:
luci/site/luci/Extensions/StorageReport.py +2 -2
@@ -1624,7 +1624,7 @@
 		value = var.getAttribute('value')
 
 		d_units = ''
-		if name in ['size', 'extent_size', 'block_size', 'size_free', 'partition_begin']:
+		if name in ('size', 'extent_size', 'block_size', 'size_free', 'partition_begin' ):
 			d_units = 'bytes'
 		if 'percent' in name:
 			d_units = '%'
@@ -1686,7 +1686,7 @@
 			d_value = str(value)
 
 		hidden = False
-		if var_type == 'hidden' or name in ['partition_begin', 'snapshot']:
+		if var_type == 'hidden' or name in ( 'partition_begin', 'snapshot' ):
 			hidden = True
 
 		if name == 'removable':
luci/site/luci/Extensions/Variable.py +261 -258

529 lines not on this page · raw message

luci/site/luci/Extensions/conga_constants.py +1 -1
@@ -122,7 +122,7 @@
 START_NODE				= 6
 RICCI_CONNECT_FAILURE	= (-1000)
 
-RICCI_CONNECT_FAILURE_MSG = 'Currently unable to reach the ricci agent on this node.  '
+RICCI_CONNECT_FAILURE_MSG = 'Currently unable to reach the ricci agent on this node. '
 
 # cluster/node create error messages
 CLUNODE_CREATE_ERRORS = [
luci/site/luci/Extensions/conga_ssl.py +31 -32

67 lines not on this page · raw message

luci/site/luci/Extensions/conga_storage_constants.py +134 -152

308 lines not on this page · raw message

luci/site/luci/Extensions/ricci_communicator.py +6 -6
@@ -21,10 +21,10 @@
 		self.__hostname = hostname
 		self.__port = port
 
-		self.__timeout_init  = 4
-		self.__timeout_auth  = 4
+		self.__timeout_init = 4
+		self.__timeout_auth = 4
 		self.__timeout_short = 6
-		self.__timeout_long  = 600
+		self.__timeout_long = 600
 
 		self.__privkey_file = '%sprivkey.pem' % CERTS_DIR_PATH
 		self.__cert_file = '%scacert.pem' % CERTS_DIR_PATH
@@ -497,7 +497,7 @@
 		raise RicciError, 'Not an XML batch node'
 
 	total = 0
-	last  = 0
+	last = 0
 	for node in batch_xml.childNodes:
 		if node.nodeType == Node.ELEMENT_NODE:
 			if node.nodeName == 'module':
@@ -536,8 +536,8 @@
 #		 -1 - undefined error occured (msg not necesarily very informative)
 #		  0 - no error (msg is empty string)
 #		 >0 - predefined error has occured
-#						(check respective API, msg will be fully descriptive)
-# * error_msg:  error message
+#				(check respective API, msg will be fully descriptive)
+# * error_msg: error message
 
 def extract_module_status(batch_xml, module_num=1):
 	if batch_xml.nodeName != 'batch':
luci/site/luci/Extensions/ricci_defines.py +58 -68

132 lines not on this page · raw message

luci/site/luci/Extensions/storage_adapters.py +2 -2
@@ -136,7 +136,7 @@
 	srs_p['absolute_url'] = '%s?%s=%s&%s=%s&%s=%s' \
 		% (url, PAGETYPE, VIEW_MAPPERS, STONAME, hostname, PT_MAPPER_TYPE, mapper_type)
 	srs_p['Description'] = pretty_names_desc
-	if pagetype_req in [ VIEW_MAPPERS, VIEW_MAPPER, ADD_SOURCES, CREATE_MAPPER, VIEW_BD ] and mapper_type_req == mapper_type:
+	if pagetype_req in ( VIEW_MAPPERS, VIEW_MAPPER, ADD_SOURCES, CREATE_MAPPER, VIEW_BD ) and mapper_type_req == mapper_type:
 		srs_p['show_children'] = True
 	else:
 		srs_p['show_children'] = False
@@ -181,7 +181,7 @@
 			% (url, PAGETYPE, VIEW_MAPPER, STONAME, hostname, PT_MAPPER_TYPE, mapper_type, PT_MAPPER_ID, sr_id)
 		sr['Description'] = pretty_name_desc
 
-		if pagetype_req in [ VIEW_MAPPER, ADD_SOURCES, VIEW_BD ] and mapper_id_req == sr_id:
+		if pagetype_req in ( VIEW_MAPPER, ADD_SOURCES, VIEW_BD ) and mapper_id_req == sr_id:
 			sr['currentItem'] = True
 		else:
 			sr['currentItem'] = False