From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 8 Dec 2006 20:47:38 -0000 Subject: [Cluster-devel] conga ./conga.spec.in.in luci/cluster/form-mac ... Message-ID: <20061208204738.8972.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-12-08 20:47:37 Modified files: . : conga.spec.in.in luci/cluster : form-macros luci/homebase : validate_cluster_add.js luci/site/luci/Extensions: cluster_adapters.py Log message: - more fence fixes - fix for most of the add node fails bug - fix for 218964 Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&r1=1.57&r2=1.58 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.125&r2=1.126 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/validate_cluster_add.js.diff?cvsroot=cluster&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.176&r2=1.177 --- conga/conga.spec.in.in 2006/12/06 23:03:35 1.57 +++ conga/conga.spec.in.in 2006/12/08 20:47:37 1.58 @@ -284,7 +284,7 @@ %changelog -* Wed Dec 06 2006 2006 Stanko Kupcevic 0.9.1-2 +* Wed Dec 06 2006 Stanko Kupcevic 0.9.1-2 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX UPDATE NOT RELEASED YET XXXXXXXXXXXXXXXXXXX --- conga/luci/cluster/form-macros 2006/12/06 22:44:18 1.125 +++ conga/luci/cluster/form-macros 2006/12/08 20:47:37 1.126 @@ -1325,7 +1325,7 @@ Hostname + tal:attributes="value cur_fencedev/hostname | cur_fencedev/ipaddr | nothing" /> @@ -2299,9 +2299,7 @@ global nodestatus python: here.getClusterStatus(request, ricci_agent); global nodeinfo python: here.getNodeInfo(modelb, nodestatus, request); global status_class python: 'node_' + (nodeinfo['nodestate'] == '0' and 'active' or (nodeinfo['nodestate'] == '1' and 'inactive' or 'unknown')); - global cluster_node_status_str python: (nodeinfo['nodestate'] == '0' and 'Cluster member' or (nodeinfo['nodestate'] == '1' and 'Currently not a cluster participant' or 'This node is not responding')); - global fenceinfo python: here.getFenceInfo(modelb, request); - global fencedevinfo python: here.getFencesInfo(modelb, request)" + global cluster_node_status_str python: (nodeinfo['nodestate'] == '0' and 'Cluster member' or (nodeinfo['nodestate'] == '1' and 'Currently not a cluster participant' or 'This node is not responding'))" /> @@ -2443,6 +2441,17 @@ + + +
+ fenceinfo: +
+ fencedevinfo: + +
+
- + + - + +
-
- - XXX - fill in any existing fence devices for this node - and update the counter number for this level - +
+
+
+ + + +
+ +
+
+ + +
+
-
-
- - XXX - fill in any existing fence devices for this node - and update the counter number for this level - +
+
+
+ + + +
+ +
+
+ + +
+
-
@@ -2671,6 +2704,7 @@
+ -
-

Fence Device Form

- -
- - - - - - +
@@ -3515,10 +3536,26 @@ +
-
- -
+ +
+

Fence Device Form

+ +
+ + + + + + +
--- conga/luci/homebase/validate_cluster_add.js 2006/09/27 22:49:09 1.4 +++ conga/luci/homebase/validate_cluster_add.js 2006/12/08 20:47:37 1.5 @@ -29,7 +29,13 @@ if (error_dialog(errors)) return (-1); - if (confirm('Add the cluster \"' + clusterName + '\" to the Luci management interface?')) + var confirm_str = ''; + if (form.addnode) + confirm_str = 'Add node' + (added_storage.length > 1 ? 's' : '') + ' to the \"' + clusterName + '\" cluster?'; + else + confirm_str = 'Add the cluster \"' + clusterName + '\" to the Luci management interface?'; + + if (confirm(confirm_str)) form.submit(); return (0); --- conga/luci/site/luci/Extensions/cluster_adapters.py 2006/12/06 22:44:18 1.176 +++ conga/luci/site/luci/Extensions/cluster_adapters.py 2006/12/08 20:47:37 1.177 @@ -280,6 +280,7 @@ if 'clusterName' in request.form: clusterName = str(request.form['clusterName']) else: + luci_log.debug_verbose('vACN00: no cluster name was given') return (False, {'errors': [ 'Cluster name is missing'], 'requestResults': requestResults }) rhn_dl = 1 @@ -301,8 +302,9 @@ try: numStorage = int(request.form['numStorage']) if numStorage < 1: - raise - except: + raise Exception, 'no nodes were added' + except Exception, e: + luci_log.debug_verbose('vACN0: %s: %s' % (clusterName, str(e))) errors.append('You must specify at least one node to add to the cluster') return (False, {'errors': [ errors ], 'requestResults': requestResults }) @@ -313,34 +315,56 @@ try: nodeList = cluster_properties['nodeList'] if len(nodeList) < 1: - raise - except: + raise Exception, 'no cluster nodes' + except Exception, e: + luci_log.debug_verbose('vACN1: %s: %s' % (clusterName, str(e))) errors.append('You must specify@least one valid node to add to the cluster') + clusterObj = None try: clusterObj = self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/' + clusterName) cluster_os = clusterObj.manage_getProperty('cluster_os') if not cluster_os: - luci_log.debug('The cluster OS property is missing for cluster ' + clusterName) - raise Exception, 'no cluster OS was found.' + raise Exception, 'no cluster OS was found in DB for %s' % clusterName + except Exception, e: + luci_log.debug_verbose('vACN2: %s: %s' % (clusterName, str(e))) try: - if len(filter(lambda x: x['os'] != cluster_os, nodeList)) > 0: - raise Exception, 'different operating systems were detected.' - except: + rc = getRicciAgent(self, clusterName) + if not rc: + raise Exception, 'cannot find a ricci agent for %s' % clusterName + cluster_os = getClusterOS(self, rc)['os'] + if clusterObj is None: + try: + clusterObj = self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/' + clusterName) + except: + pass + + try: + clusterObj.manage_addProperty('cluster_os', cluster_os, 'string') + except: + pass + except Exception, e: + luci_log.debug_verbose('vACN3: %s: %s' % (clusterName, str(e))) nodeUnauth(nodeList) + cluster_os = None cluster_properties['isComplete'] = False - errors.append('Cluster nodes must be running compatible operating systems.') - except: + errors.append('Unable to determine the cluster OS for the ' + clusterName + ' cluster.') + + try: + if cluster_os is None: + raise Exception, 'no cluster OS found for %s' % clusterName + if len(filter(lambda x: x['os'] != cluster_os, nodeList)) > 0: + raise Exception, 'different operating systems were detected.' + except Exception, e: + luci_log.debug_verbose('vACN4: %s: %s' % (clusterName, str(e))) nodeUnauth(nodeList) cluster_properties['isComplete'] = False - errors.append('Unable to determine the cluster OS for the ' + clusterName + ' cluster.') + errors.append('Cluster nodes must be running compatible operating systems.') if not cluster_properties['isComplete']: return (False, {'errors': errors, 'requestResults': cluster_properties}) - i = 0 - while i < len(nodeList): - clunode = nodeList[i] + for clunode in nodeList: try: batchNode = addClusterNodeBatch(clunode['os'], clusterName, @@ -350,9 +374,11 @@ False, rhn_dl) if not batchNode: - raise - del nodeList[i] - except: + raise Exception, 'batchnode is None' + clunode['batchnode'] = batchNode + except Exception, e: + luci_log.debug_verbose('vACN5: node add for %s failed: %s' \ + % (clunode['host'], str(e))) clunode['errors'] = True nodeUnauth(nodeList) cluster_properties['isComplete'] = False @@ -363,37 +389,42 @@ error = createClusterSystems(self, clusterName, nodeList) if error: + luci_log.debug_verbose('vACN5a: %s: %s' % (clusterName, str(e))) nodeUnauth(nodeList) cluster_properties['isComplete'] = False errors.append(error) return (False, {'errors': errors, 'requestResults': cluster_properties}) batch_id_map = {} - for i in nodeList: - clunode = nodeList[i] + for clunode in nodeList: success = True try: rc = RicciCommunicator(clunode['host']) + if not rc: + raise Exception, 'rc is None' except Exception, e: - luci_log.info('Unable to connect to the ricci daemon on host %s: %s'% (clunode['host'], str(e))) + nodeUnauth([clunode['host']]) success = False + luci_log.info('vACN6: Unable to connect to the ricci daemon on host %s: %s' % (clunode['host'], str(e))) if success: try: - resultNode = rc.process_batch(batchNode, async=True) + resultNode = rc.process_batch(clunode['batchnode'], async=True) batch_id_map[clunode['host']] = resultNode.getAttribute('batch_id') - except: + except Exception, e: + nodeUnauth([clunode['host']]) success = False + luci_log.info('vACN7: %s' % (clunode['host'], str(e))) if not success: - nodeUnauth(nodeList) cluster_properties['isComplete'] = False errors.append('An error occurred while attempting to add cluster node \"' + clunode['host'] + '\"') - return (False, {'errors': errors, 'requestResults': cluster_properties}) - messages.append('Cluster join initiated for host \"' + clunode['host'] + '\"') buildClusterCreateFlags(self, batch_id_map, clusterName) + if len(errors) > 0: + return (False, {'errors': errors, 'requestResults': cluster_properties}) + response = request.RESPONSE response.redirect(request['URL'] + "?pagetype=" + CLUSTER_CONFIG + "&clustername=" + clusterName + '&busyfirst=true')