FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 01-22-2009, 07:35 PM
 
Default conga/luci/site/luci/Extensions/ClusterModel M ...

CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL5
Changes by: rmccabe@sourceware.org 2009-01-22 20:35:28

Modified files:
luci/site/luci/Extensions/ClusterModel: ModelBuilder.py

Log message:
fix bz467464

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py.diff?cvsroot=cluster&only_with_tag =RHEL5&r1=1.1.4.9&r2=1.1.4.10

--- conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py 2008/08/04 21:49:31 1.1.4.9
+++ conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py 2009/01/22 20:35:27 1.1.4.10
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2008 Red Hat, Inc.
+# Copyright (C) 2006-2009 Red Hat, Inc.
#
# This program is free software; you can redistribute
# it and/or modify it under the terms of version 2 of the
@@ -1126,22 +1126,26 @@
return True

def check_two_node(self):
- if self.getLockType() == DLM_TYPE and self.quorumd_ptr is None:
- clusternodes_count = len(self.clusternodes_ptr.getChildren())
+ if self.getLockType() == DLM_TYPE:
+ clusternodes_count = len(self.getNodes())
#Make certain that there is a cman tag in the file
#If missing, it will not hurt to add it here
if self.CMAN_ptr is None:
cman = Cman()
self.cluster_ptr.addChild(cman)
self.CMAN_ptr = cman
+
if clusternodes_count == 2:
- self.CMAN_ptr.addAttribute('two_node', '1')
- self.CMAN_ptr.addAttribute('expected_votes', '1')
+ if not self.isQuorumd():
+ self.CMAN_ptr.addAttribute('two_node', '1')
+ self.CMAN_ptr.addAttribute('expected_votes', '1')
+ else:
+ self.CMAN_ptr.removeAttribute('two_node')
+ if self.CMAN_ptr.getAttribute('expected_votes') in ('0', '1'):
+ self.CMAN_ptr.removeAttribute('expected_votes')
else:
- if self.CMAN_ptr.getAttribute('expected_votes') in ('0', '1'):
- self.CMAN_ptr.removeAttribute('expected_votes')
self.CMAN_ptr.removeAttribute('two_node')
-
+
def dual_power_fence_check(self):
# if 2 or more power controllers reside in the same fence level,
# duplicate entries must be made for every controller with an
 
Old 01-22-2009, 08:31 PM
 
Default conga/luci/site/luci/Extensions/ClusterModel M ...

CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL5
Changes by: rmccabe@sourceware.org 2009-01-22 21:31:41

Modified files:
luci/site/luci/Extensions/ClusterModel: ModelBuilder.py
QuorumD.py

Log message:
Fix Fix bz467464

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py.diff?cvsroot=cluster&only_with_tag =RHEL5&r1=1.1.4.10&r2=1.1.4.11
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/QuorumD.py.diff?cvsroot=cluster&only_with_tag=RHEL 5&r1=1.1.4.2&r2=1.1.4.3

--- conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py 2009/01/22 20:35:27 1.1.4.10
+++ conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py 2009/01/22 21:31:41 1.1.4.11
@@ -1101,6 +1101,25 @@
continue
self.__removeReferences(tagobj, t)

+ def get_expected_votes(self):
+ node_votes = 0
+ qdisk_votes = 0
+
+ if self.quorumd_ptr is not None:
+ try:
+ qdisk_votes = int(self.quorumd_ptr.getVotes())
+ except:
+ qdisk_votes = 0
+
+ for i in self.getNodes():
+ try:
+ cur_votes = int(i.getVotes())
+ except:
+ cur_votes = 1
+ node_votes += cur_votes
+
+ return node_votes + qdisk_votes
+
def updateReferences(self):
self.__updateReferences(self.cluster_ptr)
def __updateReferences(self, level):
@@ -1135,17 +1154,17 @@
self.cluster_ptr.addChild(cman)
self.CMAN_ptr = cman

- if clusternodes_count == 2:
- if not self.isQuorumd():
+ if not self.isQuorumd():
+ if clusternodes_count == 2:
self.CMAN_ptr.addAttribute('two_node', '1')
self.CMAN_ptr.addAttribute('expected_votes', '1')
else:
self.CMAN_ptr.removeAttribute('two_node')
- if self.CMAN_ptr.getAttribute('expected_votes') in ('0', '1'):
- self.CMAN_ptr.removeAttribute('expected_votes')
+ self.CMAN_ptr.removeAttribute('expected_votes')
else:
self.CMAN_ptr.removeAttribute('two_node')
-
+ self.CMAN_ptr.addAttribute('expected_votes', str(self.get_expected_votes()))
+
def dual_power_fence_check(self):
# if 2 or more power controllers reside in the same fence level,
# duplicate entries must be made for every controller with an
--- conga/luci/site/luci/Extensions/ClusterModel/QuorumD.py 2008/01/23 04:44:34 1.1.4.2
+++ conga/luci/site/luci/Extensions/ClusterModel/QuorumD.py 2009/01/22 21:31:41 1.1.4.3
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2008 Red Hat, Inc.
+# Copyright (C) 2006-2009 Red Hat, Inc.
#
# This program is free software; you can redistribute
# it and/or modify it under the terms of version 2 of the
@@ -13,3 +13,12 @@
def __init__(self):
TagObject.__init__(self)
self.TAG_NAME = TAG_NAME
+
+ def getVotes(self):
+ try:
+ num_votes = self.getAttribute('votes')
+ if num_votes is not None:
+ return int(num_votes)
+ except:
+ pass
+ return 0
 

Thread Tools




All times are GMT. The time now is 07:21 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org