From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 12 Feb 2007 20:24:31 -0000 Subject: [Cluster-devel] conga/luci/site/luci/Extensions cluster_adapte ... Message-ID: <20070212202431.25375.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 Changes by: rmccabe at sourceware.org 2007-02-12 20:24:28 Modified files: luci/site/luci/Extensions: cluster_adapters.py homebase_adapters.py ricci_communicator.py Log message: - A handful of fixes for bugs that show up when unlikely exceptions are raised - Fix for a bug that could cause luci to fail to try to authenticate to ricci agents Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.236&r2=1.237 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/homebase_adapters.py.diff?cvsroot=cluster&r1=1.49&r2=1.50 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_communicator.py.diff?cvsroot=cluster&r1=1.24&r2=1.25 --- conga/luci/site/luci/Extensions/cluster_adapters.py 2007/02/08 16:00:36 1.236 +++ conga/luci/site/luci/Extensions/cluster_adapters.py 2007/02/12 20:24:28 1.237 @@ -323,7 +323,9 @@ try: resultNode = rc.process_batch(batchNode, async=True) batch_id_map[i] = resultNode.getAttribute('batch_id') - except: + except Exception, e: + luci_log.debug_verbose('validateCreateCluster0: %s: %s' \ + % (i, str(e))) errors.append('An error occurred while attempting to add cluster node \"%s\"' % i) if len(batch_id_map) == 0: request.SESSION.set('create_cluster', add_cluster) @@ -448,6 +450,7 @@ prev_auth = rc.authed() cur_system['prev_auth'] = prev_auth + try: if prev_auth: messages.append('Host %s is already authenticated.' \ @@ -457,7 +460,7 @@ if not rc.authed(): raise Exception, 'authentication failed' - except: + except Exception, e: cur_system['errors'] = True incomplete = True errors.append('Error authenticating to %s: %s' \ @@ -617,7 +620,7 @@ break if code == -1: errors.append(batch_ret[1]) - raise Exception, batch_ret[1] + raise Exception, str(batch_ret[1]) if code == False: time.sleep(0.5) except Exception, e: @@ -4137,13 +4140,13 @@ def clusterDelete(self, model): num_errors = clusterStop(self, model, delete=True) - if num_errors < 1: - try: - clustername = model.getClusterName() - except Exception, e: - luci_log.debug_verbose('clusterDelete0: unable to get cluster name') - return None + try: + clustername = model.getClusterName() + except Exception, e: + luci_log.debug_verbose('clusterDelete0: unable to get cluster name') + return None + if num_errors < 1: try: delCluster(self, clustername) except Exception, e: --- conga/luci/site/luci/Extensions/homebase_adapters.py 2007/02/09 18:30:44 1.49 +++ conga/luci/site/luci/Extensions/homebase_adapters.py 2007/02/12 20:24:28 1.50 @@ -156,7 +156,7 @@ if len(sysData) < 2 or not sysData[1]: raise Exception, 'no password' cur_pass = sysData[1] - cur_entry['passwd'] = '' + cur_entry['passwd'] = cur_pass except: luci_log.debug_verbose('vACI1: %s no password given') request.SESSION.set('add_cluster_initial', cur_entry) @@ -338,7 +338,7 @@ for i in node_list: cur_node = { 'host': i } if same_node_passwds: - cur_node['passwd'] = '' + cur_node['passwd'] = cur_pass add_cluster['nodes'][i] = cur_node request.SESSION.set('add_cluster', add_cluster) request.response.redirect('/luci/homebase/index_html?pagetype=%s' % HOMEBASE_ADD_CLUSTER) @@ -382,7 +382,7 @@ cur_passwd = None else: cur_passwd = sysData[1] - cur_system['passwd'] = '' + cur_system['passwd'] = cur_passwd try: cur_fp = request.form['__SYSTEM%dFingerprint' % i].strip() --- conga/luci/site/luci/Extensions/ricci_communicator.py 2007/01/04 00:19:49 1.24 +++ conga/luci/site/luci/Extensions/ricci_communicator.py 2007/02/12 20:24:28 1.25 @@ -165,7 +165,7 @@ pass if not self.authed(): - raise RicciError, 'not authenticated to host %s', self.__hostname + raise RicciError, 'not authenticated to host %s' % self.__hostname # construct request doc = minidom.Document()