cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/luci/site/luci/Extensions LuciClusterInf ...
Date: 16 Jul 2007 21:35:18 -0000	[thread overview]
Message-ID: <20070716213518.17954.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2007-07-16 21:35:17

Modified files:
	luci/site/luci/Extensions: LuciClusterInfo.py LuciDB.py 
	                           RicciQueries.py 

Log message:
	More fixes for 247521

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciClusterInfo.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.4.2&r2=1.1.4.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciDB.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.4.2&r2=1.1.4.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/RicciQueries.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.4.2&r2=1.1.4.3

--- conga/luci/site/luci/Extensions/LuciClusterInfo.py	2007/06/19 15:54:10	1.1.4.2
+++ conga/luci/site/luci/Extensions/LuciClusterInfo.py	2007/07/16 21:35:17	1.1.4.3
@@ -149,12 +149,14 @@
 	if not doc:
 		try:
 			from LuciDB import getClusterStatusDB
-			fvars = GetReqVars(request, [ 'clustername' ])
-
-			clustername = fvars['clustername']
-			if clustername is None:
-				raise Exception, 'unable to determine cluster name'
+			if cluname:
+				clustername = cluname
+			else:
+				fvars = GetReqVars(request, [ 'clustername' ])
 
+				clustername = fvars['clustername']
+				if clustername is None:
+					raise Exception, 'unable to determine cluster name'
 			cinfo = getClusterStatusDB(self, clustername)
 			if not cinfo or len(cinfo) < 1:
 				raise Exception, 'cinfo is None'
@@ -1526,6 +1528,7 @@
 		model = ModelBuilder(0, None, None, cluster_conf_node)
 		if not model:
 			raise Exception, 'ModelBuilder() returned None'
+		model.setIsVirtualized(isVirtualized)
 	except Exception, e:
 		try:
 			if LUCI_DEBUG_MODE is True:
@@ -1535,7 +1538,6 @@
 				luci_log.debug_verbose('GMB1: ModelBuilder failed')
 		return None
 
-	model.setIsVirtualized(isVirtualized)
 	return model
 
 def getModelForCluster(self, clustername):
@@ -1544,19 +1546,18 @@
 	rc = getRicciAgent(self, clustername)
 	if not rc:
 		if LUCI_DEBUG_MODE is True:
-			luci_log.debug_verbose('GMFC0: unable to find a ricci agent for %s' % clustername)
+			luci_log.debug_verbose('GMFC0: no ricci agent for %s' % clustername)
 		return None
 
 	try:
 		model = getModelBuilder(None, rc, rc.dom0())
 		if not model:
 			raise Exception, 'model is none'
+		return model
 	except Exception, e:
 		if LUCI_DEBUG_MODE is True:
 			luci_log.debug_verbose('GMFC1: unable to get model builder for %s: %r %s' % (clustername, e, str(e)))
-		return None
-
-	return model
+	return None
 
 def getClusterOS(self, rc):
 	from HelperFunctions import resolveOSType
--- conga/luci/site/luci/Extensions/LuciDB.py	2007/06/27 06:19:22	1.1.4.2
+++ conga/luci/site/luci/Extensions/LuciDB.py	2007/07/16 21:35:17	1.1.4.3
@@ -946,8 +946,8 @@
 
 	nodelist = getClusterDBNodes(self, clustername)
 	if len(nodelist) < 1:
-		if LUCI_DEBUG_MODE is True:
-			luci_log.debug_verbose('GCSDB0a: removing cluster %s because it has no nodes' % clustername)
+		luci_log.info('Removing cluster %s because it has no nodes' \
+			% clustername)
 		try:
 			clusters_dir = self.restrictedTraverse(CLUSTER_FOLDER_PATH)
 			clusters_dir.manage_delObjects([clustername])
@@ -960,7 +960,7 @@
 	for node in nodelist:
 		node_val = {}
 		node_val['type'] = 'node'
-		node_val['name'] = node
+		node_val['name'] = node[0]
 		node_val['clustered'] = '[unknown]'
 		node_val['online'] = '[unknown]'
 		node_val['error'] = True
--- conga/luci/site/luci/Extensions/RicciQueries.py	2007/06/27 06:19:22	1.1.4.2
+++ conga/luci/site/luci/Extensions/RicciQueries.py	2007/07/16 21:35:17	1.1.4.3
@@ -289,6 +289,9 @@
 	batch_str = '<module name="cluster"><request API_version="1.0"><function_call name="status"/></request></module>'
 	ricci_xml = rc.batch_run(batch_str, async=False)
 
+	if not ricci_xml:
+		return None
+
 	try:
 		cluster_tags = ricci_xml.getElementsByTagName('cluster')
 	except Exception, e:
@@ -300,10 +303,12 @@
 		if LUCI_DEBUG_MODE is True:
 			luci_log.debug_verbose('GCSB1: %d entries - expecting 1' \
 				% len(cluster_tags))
+			return None
 	elif len(cluster_tags) > 1:
 		if LUCI_DEBUG_MODE is True:
 			luci_log.debug_verbose('GCSB2: %d entries, expecting 1 use first' \
 				% len(cluster_tags))
+
 	try:
 		cluster_node = cluster_tags[0]
 		if not cluster_node:



             reply	other threads:[~2007-07-16 21:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-16 21:35 rmccabe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-09-21 16:06 [Cluster-devel] conga/luci/site/luci/Extensions LuciClusterInf rmccabe
2007-07-26  5:52 rmccabe
2007-07-03 17:06 rmccabe
2007-06-28 19:31 rmccabe
2007-06-08 18:27 rmccabe
2007-05-30 22:06 rmccabe
2007-05-16 21:27 rmccabe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070716213518.17954.qmail@sourceware.org \
    --to=rmccabe@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).