From mboxrd@z Thu Jan 1 00:00:00 1970 From: jparsons@sourceware.org Date: 25 Jul 2006 20:01:13 -0000 Subject: [Cluster-devel] conga/luci/site/luci/Extensions cluster_adapte ... Message-ID: <20060725200113.25800.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: jparsons at sourceware.org 2006-07-25 20:01:12 Modified files: luci/site/luci/Extensions: cluster_adapters.py Log message: Fixed quorum stuff in cluster info Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.13&r2=1.14 --- conga/luci/site/luci/Extensions/cluster_adapters.py 2006/07/25 00:56:56 1.13 +++ conga/luci/site/luci/Extensions/cluster_adapters.py 2006/07/25 20:01:12 1.14 @@ -923,7 +923,47 @@ response = req.RESPONSE response.redirect(req['HTTP_REFERER'] + "&busyfirst=true") + +def processClusterProps(self, ricci_agent, request): + #First, retrieve cluster.conf from session + conf = request.SESSION.get('conf') + model = ModelBuilder(0, None, None, conf) + + #Next, determine actiontype and switch on it + actiontype = request[ACTIONTYPE] + + if actiontype == BASECLUSTER: + cp = model.getClusterPtr() + cfgver = cp.getConfigVersion() + + rcfgver = request['cfgver'] + + if cfgver != rcfgver: + cint = int(cfgver) + rint = int(rcfgver) + if rint > cint: + cp.setConfigVersion(rcfgver) + + rname = request['cluname'] + name = model.getClusterAlias() + + if rname != name: + cp.addAttribute('alias', rname) + + response = request.RESPONSE + response.redirect(request['HTTP_REFERER'] + "&busyfirst=true") + return + + elif actiontype == FENCEDAEMON: + + elif actiontype == MULTICAST: + + elif actiontype == QUORUMD: + + else: + return + def getClusterInfo(self, model, req): cluname = req[CLUNAME] baseurl = req['URL'] + "?" + PAGETYPE + "=" + CLUSTER_PROCESS + "&" + CLUNAME + "=" + cluname + "&" @@ -973,14 +1013,38 @@ map['quorumd_url'] = quorumd_url is_quorumd = model.isQuorumd() map['is_quorumd'] = is_quorumd + map['interval'] = "" + map['tko'] = "" + map['votes'] = "" + map['min_score'] = "" + map['device'] = "" + map['label'] = "" if is_quorumd: qdp = model.getQuorumdPtr() interval = qdp.getAttribute('interval') + if interval != None: + map['interval'] = interval + tko = qdp.getAttribute('tko') + if tko != None: + map['tko'] = tko + votes = qdp.getAttribute('votes') + if votes != None: + map['votes'] = votes + min_score = qdp.getAttribute('min_score') + if min_score != None: + map['min_score'] = min_score + device = qdp.getAttribute('device') + if device != None: + map['device'] = device + label = qdp.getAttribute('label') + if label != None: + map['label'] = label + heuristic_kids = qdp.getChildren() h_ctr = 0 hlist = list() @@ -995,15 +1059,21 @@ hinterval = kid.getAttribute('interval') if hprog == None: continue - hmap['hname'] = hname + if hname != None: + hmap['hname'] = hname + else: + hmap['hname'] = "" hmap['hprog'] = hprog if hscore != None: hmap['hscore'] = hscore + else: + hmap['hscore'] = "" if hinterval != None: hmap['hinterval'] = hinterval + else: + hmap['hinterval'] = "" hlist.append(hmap) - if len(hlist) > 0: - map['hlist'] = hlist + map['hlist'] = hlist return map