From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 31 Oct 2006 19:09:28 -0000 Subject: [Cluster-devel] conga/luci homebase/form-macros site/luci/Exte ... Message-ID: <20061031190928.12435.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 2006-10-31 19:09:28 Modified files: luci/homebase : form-macros luci/site/luci/Extensions: homebase_adapters.py Log message: back out patch that tried to address the memory use problems Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.44.2.1&r2=1.44.2.2 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/homebase_adapters.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.34.2.3&r2=1.34.2.4 --- conga/luci/homebase/form-macros 2006/10/31 17:28:04 1.44.2.1 +++ conga/luci/homebase/form-macros 2006/10/31 19:09:25 1.44.2.2 @@ -1,7 +1,7 @@ - $Id: form-macros,v 1.44.2.1 2006/10/31 17:28:04 rmccabe Exp $ + $Id: form-macros,v 1.44.2.2 2006/10/31 19:09:25 rmccabe Exp $ @@ -554,11 +554,8 @@ set_page_title('Luci ??? homebase ??? Add a running cluster to be managed by Luci'); - - - +

Add Cluster

--- conga/luci/site/luci/Extensions/homebase_adapters.py 2006/10/31 17:28:04 1.34.2.3 +++ conga/luci/site/luci/Extensions/homebase_adapters.py 2006/10/31 19:09:27 1.34.2.4 @@ -13,6 +13,15 @@ from ricci_communicator import CERTS_DIR_PATH from clusterOS import resolveOSType from conga_constants import * +from LuciSyslog import LuciSyslog, LuciSyslogError + +try: + luci_log = LuciSyslog() +except LuciSyslogError, e: + pass + +class InCluster(Exception): + pass def siteIsSetup(self): try: @@ -296,7 +305,8 @@ try: sessionData = request.SESSION.get('checkRet') requestResults = sessionData['requestResults'] - except: + except Exception, e: + luci_log.debug_verbose('VAC0: error getting session obj: %s' % str(e)) try: clusterName = request.form['clusterName'] except: @@ -304,24 +314,27 @@ try: nodeList = requestResults['nodeList'] + luci_log.debug_verbose('VAC1: unauth to node list') 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': [] } }) + return (False, { 'errors': [ 'A data integrity error has occurred. Please attempt adding the cluster again.' ], 'requestResults': { 'clusterName': clusterName, 'isComplete': False, 'nodeList': [], 'redirect': HOMEBASE_ADD_CLUSTER_INITIAL } }) try: clusterName = request.form['clusterName'] if not clusterName: - raise - except: + raise Exception, 'no cluster name was found' + except Exception, e: + luci_log.debug_verbose('VAC2: no cluser name found: %s', str(e)) return (False, { 'errors': ['No cluster name was given.'], 'requestResults': requestResults }) try: nodeList = requestResults['nodeList'] if not nodeList or len(nodeList) < 1: - raise - except: + raise Exception, 'no node list found' + except Exception, e: + luci_log.debug_verbose('VAC3: no nodeList found: %s', str(e)) return (False, { 'errors': ['No cluster nodes were given.'], 'requestResults': requestResults }) try: @@ -338,13 +351,15 @@ try: numStorage = int(request.form['numStorage']) if numStorage != len(nodeList): - raise - except: - nodeUnauth(nodeList) + raise Exception, 'numstorage != len(nodelist)' + except Exception, e: try: requestResults['isComplete'] = False + luci_log.debug_verbose('VAC4: error: %s' % str(e)) except: pass + + nodeUnauth(nodeList) return (False, { 'errors': [ 'Unknown number of nodes entered' ], 'requestResults': requestResults }) @@ -372,8 +387,9 @@ oldNode = rnodeHash[k] if not oldNode: + luci_log.debug_verbose('VAC5: node %s not found', sysData[0]) nodeUnauth(nodeList) - return (False, { 'errors': [ 'A data integrity error has occurred. Please attempt adding the cluster again.' ], 'requestResults': { 'clusterName': clusterName, 'nodeList': nodeList, 'isComplete': False } }) + return (False, { 'errors': [ 'A data integrity error has occurred. Please attempt adding the cluster again.' ], 'requestResults': { 'clusterName': clusterName, 'nodeList': nodeList, 'isComplete': False, 'redirect': HOMEBASE_ADD_CLUSTER_INITIAL } }) if oldNode['host'] != node['host']: del nodeHash[oldNode['host']] @@ -658,20 +674,23 @@ except: sessionData = None - try: - request.SESSION.delete('checkRet') - except: - pass - if 'ACTUAL_URL' in request: url = request['ACTUAL_URL'] else: url = '.' - try: + if 'pagetype' in request.form: pagetype = int(request.form['pagetype']) + else: + try: request.SESSION.set('checkRet', {}) + except: pass + return homebasePortal(self, request, '.', '0') + + try: validatorFn = formValidators[pagetype - 1] except: + try: request.SESSION.set('checkRet', {}) + except: pass return homebasePortal(self, request, '.', '0') if validatorFn == validateAddClusterInitial or validatorFn == validateAddCluster: @@ -699,7 +718,7 @@ return homebaseControlPost(self, request) try: - request.SESSION.delete('checkRet') + request.SESSION.set('checkRet', {}) except: pass @@ -1003,6 +1022,7 @@ def manageCluster(self, clusterName, nodeList): clusterName = str(clusterName) + luci_log.debug_verbose('manageCluster for %s' % clusterName) try: clusters = self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/')