From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 13 Oct 2006 17:04:14 -0000 Subject: [Cluster-devel] conga/luci homebase/form-macros site/luci/Exte ... Message-ID: <20061013170414.30404.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 2006-10-13 17:04:11 Modified files: luci/homebase : form-macros luci/site/luci/Extensions: homebase_adapters.py ricci_bridge.py Log message: fix for bz #209997 Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-macros.diff?cvsroot=cluster&r1=1.39&r2=1.40 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/homebase_adapters.py.diff?cvsroot=cluster&r1=1.29&r2=1.30 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_bridge.py.diff?cvsroot=cluster&r1=1.26&r2=1.27 --- conga/luci/homebase/form-macros 2006/10/09 16:16:11 1.39 +++ conga/luci/homebase/form-macros 2006/10/13 17:04:09 1.40 @@ -1,7 +1,7 @@ - $Id: form-macros,v 1.39 2006/10/09 16:16:11 rmccabe Exp $ + $Id: form-macros,v 1.40 2006/10/13 17:04:09 rmccabe Exp $ @@ -482,19 +482,19 @@ set_page_title('Luci ??? homebase ??? Add a running cluster to be managed by Luci'); - + -
+

Add Cluster

+ + - -

Add Cluster

- @@ -522,7 +523,7 @@ tal:define="global sysNum python: 0" /> - + @@ -564,6 +565,13 @@ + +
+ + A data integrity error has occurred. Please attempt to add this cluster to the Luci management interface again. + + +
--- conga/luci/site/luci/Extensions/homebase_adapters.py 2006/10/12 19:40:44 1.29 +++ conga/luci/site/luci/Extensions/homebase_adapters.py 2006/10/13 17:04:11 1.30 @@ -300,15 +300,38 @@ clusterName = request.form['clusterName'] except: clusterName = '' - return (False, { 'errors': [ 'A data integrity error has occurred. Please attempt adding the cluster again.' ], 'requestResults': { 'clusterName': clusterName } }) + + try: + nodeList = requestResults['nodeList'] + nodeUnauth(nodeList) + except: + pass + + return (False, { 'errors': [ 'A data integrity error has occurred. Please attempt adding the cluster again.' ], 'requestResults': { 'clusterName': clusterName, 'isComplete': False, 'nodeList': [] } }) - if not 'clusterName' in request.form or request.form['clusterName'] == '': - return (False, { 'errors': ['No cluster name given'], 'requestResults': requestResults }) + try: + clusterName = request.form['clusterName'] + if not clusterName: + raise + except: + return (False, { 'errors': ['No cluster name was given.'], 'requestResults': requestResults }) + + try: + nodeList = requestResults['nodeList'] + if not nodeList or len(nodeList) < 1: + raise + except: + return (False, { 'errors': ['No cluster nodes were given.'], 'requestResults': requestResults }) - clusterName = request.form['clusterName'] - nodeList = requestResults['nodeList'] - nodeHash = requestResults['nodeHash'] - rnodeHash = requestResults['rnodeHash'] + try: + nodeHash = requestResults['nodeHash'] + except: + nodeHash = {} + + try: + rnodeHash = requestResults['rnodeHash'] + except: + rnodeHash = {} # This should never fail try: @@ -317,6 +340,10 @@ raise except: nodeUnauth(nodeList) + try: + requestResults['isComplete'] = False + except: + pass return (False, { 'errors': [ 'Unknown number of nodes entered' ], 'requestResults': requestResults }) @@ -345,7 +372,7 @@ if not oldNode: nodeUnauth(nodeList) - return (False, { 'errors': [ 'A data integrity error has occurred. Please attempt adding the cluster again.' ], 'requestResults': { 'clusterName': clusterName } }) + return (False, { 'errors': [ 'A data integrity error has occurred. Please attempt adding the cluster again.' ], 'requestResults': { 'clusterName': clusterName, 'nodeList': nodeList, 'isComplete': False } }) if oldNode['host'] != node['host']: del nodeHash[oldNode['host']] @@ -679,9 +706,9 @@ raise if havePermAddCluster(self): addCluster = {} - addCluster['Title'] = 'Add a Cluster' + addCluster['Title'] = 'Add an Existing Cluster' addCluster['absolute_url'] = url + '?pagetype=' + HOMEBASE_ADD_CLUSTER - addCluster['Description'] = 'Add a cluster to the Luci cluster management interface.' + addCluster['Description'] = 'Add an existing cluster to the Luci cluster management interface.' if pagetype == HOMEBASE_ADD_CLUSTER: addCluster['currentItem'] = True ret['curIndex'] = index @@ -909,7 +936,8 @@ try: sessionData = request.SESSION.get('checkRet') nodeUnauth(sessionData['requestResults']['nodeList']) - except: pass + except: + pass def manageCluster(self, clusterName, nodeList): clusterName = str(clusterName) --- conga/luci/site/luci/Extensions/ricci_bridge.py 2006/10/12 22:41:27 1.26 +++ conga/luci/site/luci/Extensions/ricci_bridge.py 2006/10/13 17:04:11 1.27 @@ -13,7 +13,6 @@ def __init__(self, hostname, port=11111): self.__hostname = hostname self.__port = port - return def process(self, xml_out):
@@ -511,10 +511,11 @@
-
+
Check if storage system passwords are identical.
-
 
+