From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 26 Jul 2007 04:21:00 -0000 Subject: [Cluster-devel] conga/luci/site/luci/Extensions LuciClusterAct ... Message-ID: <20070726042100.19084.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: conga Branch: RHEL5 Changes by: rmccabe at sourceware.org 2007-07-26 04:20:59 Modified files: luci/site/luci/Extensions: LuciClusterActions.py LuciDB.py RicciQueries.py conga_constants.py Log message: Fix for bz249291 Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciClusterActions.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.3&r2=1.1.4.4 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.3&r2=1.1.4.4 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_constants.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.19.2.12&r2=1.19.2.13 --- conga/luci/site/luci/Extensions/LuciClusterActions.py 2007/06/19 15:54:10 1.1.4.2 +++ conga/luci/site/luci/Extensions/LuciClusterActions.py 2007/07/26 04:20:59 1.1.4.3 @@ -245,7 +245,11 @@ return None return True -def NodeLeaveCluster(self, rc, clustername, nodename_resolved): +def NodeLeaveCluster( self, + rc, + clustername, + nodename_resolved, + stop_cluster=False): reported_cluname = None try: cluster_info = rc.cluster_info() @@ -266,7 +270,7 @@ % nodename_resolved) return None - batch_number, result = rq.nodeLeaveCluster(rc) + batch_number, result = rq.nodeLeaveCluster(rc, cluster_shutdown=stop_cluster) if batch_number is None or result is None: if LUCI_DEBUG_MODE is True: luci_log.debug_verbose('NLC2: %s: batch_number or result is None' \ @@ -367,7 +371,7 @@ # First, delete cluster.conf from node to be deleted. # next, have node leave cluster. - batch_number, result = rq.nodeLeaveCluster(rc, purge=False) + batch_number, result = rq.nodeLeaveCluster(rc, purge=True) if batch_number is None or result is None: if LUCI_DEBUG_MODE is True: luci_log.debug_verbose('ND5: batch_number and/or result is None') @@ -505,7 +509,8 @@ luci_log.debug_verbose('CStop1: [1] nodeDelete failed') errors += 1 else: - ret = NodeLeaveCluster(self, rc, clustername, nodename_resolved) + ret = NodeLeaveCluster(self, rc, clustername, + nodename_resolved, stop_cluster=True) if ret is None: if LUCI_DEBUG_MODE is True: luci_log.debug_verbose('CStop2: [0] nodeLeave %s' \ --- conga/luci/site/luci/Extensions/LuciDB.py 2007/07/16 21:35:17 1.1.4.3 +++ conga/luci/site/luci/Extensions/LuciDB.py 2007/07/26 04:20:59 1.1.4.4 @@ -825,6 +825,7 @@ if LUCI_DEBUG_MODE is True: luci_log.debug_verbose('GRA8: cluster name is none for %s' \ % ricci_hostname) + raise Exception, '%s not in a cluster' % ricci_hostname cur_alias = str(clu_info[1]).strip().lower() if not cur_alias: --- conga/luci/site/luci/Extensions/RicciQueries.py 2007/07/16 21:35:17 1.1.4.3 +++ conga/luci/site/luci/Extensions/RicciQueries.py 2007/07/26 04:20:59 1.1.4.4 @@ -701,17 +701,19 @@ try: ret = rc.process_batch(batch) + if not ret: + raise Exception, 'no XML response' except Exception, e: if LUCI_DEBUG_MODE is True: luci_log.debug_verbose('GCC1: process_batch error for %s: %r %s' \ % (system_info, e, str(e))) return None - if not ret: - return None - var_nodes = ret.getElementsByTagName('var') for i in var_nodes: if i.getAttribute('name') == 'cluster.conf': return i.childNodes[0] + + if LUCI_DEBUG_MODE is True: + luci_log.debug_verbose('GCC2: no conf node found') return None --- conga/luci/site/luci/Extensions/conga_constants.py 2007/06/27 07:43:17 1.19.2.12 +++ conga/luci/site/luci/Extensions/conga_constants.py 2007/07/26 04:20:59 1.19.2.13 @@ -134,7 +134,7 @@ 'A problem occurred when starting this node: %s' ] -REDIRECT_SEC = 3 +REDIRECT_SEC = 5 # cluster/node create error status messages PRE_INSTALL = 'The install state is not yet complete.'