From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 7 Nov 2006 21:33:52 -0000 Subject: [Cluster-devel] conga/luci cluster/form-macros cluster/index_h ... Message-ID: <20061107213352.31252.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-11-07 21:33:52 Modified files: luci/cluster : form-macros index_html resource-form-macros luci/site/luci/Extensions: cluster_adapters.py Log message: - fix fenced parameter updates (properties must be strings, not ints) - fix more disappearing model builder object problems - add a configure action in the bottom left portal for each cluster Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.100&r2=1.101 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/index_html.diff?cvsroot=cluster&r1=1.26&r2=1.27 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&r1=1.22&r2=1.23 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.152&r2=1.153 --- conga/luci/cluster/form-macros 2006/11/07 20:28:36 1.100 +++ conga/luci/cluster/form-macros 2006/11/07 21:33:52 1.101 @@ -2176,7 +2176,6 @@
-

Path to configuration file:

Name of configuration file:

@@ -2185,7 +2184,6 @@
-

Properties for Xen VM

--- conga/luci/cluster/index_html 2006/11/07 20:28:36 1.26 +++ conga/luci/cluster/index_html 2006/11/07 21:33:52 1.27 @@ -164,9 +164,17 @@ + + + + + + + --- conga/luci/cluster/resource-form-macros 2006/10/30 20:42:03 1.22 +++ conga/luci/cluster/resource-form-macros 2006/11/07 21:33:52 1.23 @@ -43,8 +43,7 @@ + global rescInf python: here.getResourcesInfo(modelb, request)" />
@@ -258,44 +257,43 @@

Configure

- +
- + - +
- + - +
- + - +
- + - +
- + - +
- + - +
- + - +
- +
--- conga/luci/site/luci/Extensions/cluster_adapters.py 2006/11/07 20:14:15 1.152 +++ conga/luci/site/luci/Extensions/cluster_adapters.py 2006/11/07 21:33:52 1.153 @@ -516,7 +516,6 @@ try: model.usesMulticast = True model.mcast_address = addr_str - model.setModified(True) except Exception, e: luci_log.debug('Error updating mcast properties: %s' % str(e)) errors.append('Unable to update cluster multicast properties') @@ -720,8 +719,8 @@ if post_join_delay == old_pj_delay and post_fail_delay == old_pf_delay: errors.append('No fence daemon properties were changed.') else: - fd.setPostJoinDelay(post_join_delay) - fd.setPostFailDelay(post_fail_delay) + fd.setPostJoinDelay(str(post_join_delay)) + fd.setPostFailDelay(str(post_fail_delay)) except Exception, e: luci_log.debug_verbose('Unable to update fence daemon properties: %s' % str(e)) errors.append('An error occurred while attempting to update fence daemon properties.') @@ -764,7 +763,7 @@ return (False, {'errors': ['No cluster model was found.']}) try: - model = getModelBuilder(rc, rc.dom0()) + model = getModelBuilder(None, rc, rc.dom0()) if not model: raise Exception, 'model is none' except Exception, e: @@ -807,7 +806,8 @@ try: config_ver = int(cp.getConfigVersion()) + 1 # always increment the configuration version - cp.setConfigVersion(config_ver) + cp.setConfigVersion(str(config_ver)) + model.setModified(True) conf_str = model.exportModelAsString() if not conf_str: raise Exception, 'conf_str is none' @@ -1259,6 +1259,19 @@ kids.append(rvadd) kids.append(rvcfg) rv['children'] = kids + ################################################################ + + cprop = {} + cprop['Title'] = 'Configure' + cprop['cfg_type'] = 'configuration paramters' + cprop['absolute_url'] = url + '?pagetype=' + CLUSTER_CONFIG + '&clustername=' + cluname + cprop['Description'] = 'Change cluster configuration parameters' + cprop['show_children'] = False + if pagetype == CLUSTER_CONFIG: + cprop['currentItem'] = True + else: + cprop['currentItem'] = False + ################################################################# fd = {} fd['Title'] = "Failover Domains" @@ -1403,6 +1416,7 @@ mylist.append(nd) mylist.append(sv) mylist.append(rv) + mylist.append(cprop) mylist.append(fd) mylist.append(fen) @@ -2076,7 +2090,7 @@ luci_log.debug_verbose('GCI1: unable to find a ricci agent for the %s cluster' % cluname) return {} try: - model = getModelBuilder(rc, rc.dom0()) + model = getModelBuilder(None, rc, rc.dom0()) if not model: raise Exception, 'model is none' @@ -4350,24 +4364,27 @@ return True -def getModelBuilder(rc, isVirtualized): +def getModelBuilder(self, rc, isVirtualized): try: cluster_conf_node = getClusterConf(rc) if not cluster_conf_node: - raise - except: - luci_log.debug('unable to get cluster_conf_node in getModelBuilder') + raise Exception, 'getClusterConf returned None' + except Exception, e: + luci_log.debug_verbose('GMB0: unable to get cluster_conf_node in getModelBuilder: %s' % str(e)) return None try: modelb = ModelBuilder(0, None, None, cluster_conf_node) + if not modelb: + raise Exception, 'ModelBuilder returned None' except Exception, e: try: - luci_log.debug('An error occurred while trying to get modelb for conf \"%s\": %s' % (cluster_conf_node.toxml(), str(e))) + luci_log.debug_verbose('GMB1: An error occurred while trying to get modelb for conf \"%s\": %s' % (cluster_conf_node.toxml(), str(e))) except: - pass + luci_log.debug_verbose('GMB1: ModelBuilder failed') - modelb.setIsVirtualized(isVirtualized) + if modelb: + modelb.setIsVirtualized(isVirtualized) return modelb def set_node_flag(self, cluname, agent, batchid, task, desc):