cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] conga/luci/site/luci/Extensions/ClusterModel M ...
@ 2007-05-08 21:31 rmccabe
  0 siblings, 0 replies; 6+ messages in thread
From: rmccabe @ 2007-05-08 21:31 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	EXPERIMENTAL
Changes by:	rmccabe at sourceware.org	2007-05-08 21:31:00

Modified files:
	luci/site/luci/Extensions/ClusterModel: ModelBuilder.py 
Added files:
	luci/site/luci/Extensions/ClusterModel: SAPDatabase.py 
	                                        SAPInstance.py 

Log message:
	recognize SAPInstance and SAPDatabase tags in cluster.conf

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/SAPDatabase.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/SAPInstance.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.1.2.1&r2=1.1.2.2

--- conga/luci/site/luci/Extensions/ClusterModel/Attic/ModelBuilder.py	2007/05/03 20:16:38	1.1.2.1
+++ conga/luci/site/luci/Extensions/ClusterModel/Attic/ModelBuilder.py	2007/05/08 21:30:59	1.1.2.2
@@ -24,6 +24,8 @@
 from OpenLDAP import OpenLDAP
 from Postgres8 import Postgres8
 from Tomcat5 import Tomcat5
+from SAPInstance import SAPInstance
+from SAPDatabase import SAPDatabase
 from Multicast import Multicast
 from FenceDaemon import FenceDaemon
 from FenceXVMd import FenceXVMd
@@ -81,6 +83,8 @@
              'script': Script,
              'nfsexport': NFSExport, 
              'nfsclient': NFSClient,
+             'SAPInstance': SAPInstance,
+             'SABDatabase': SAPDatabase,
              'device': Device }
 
 
@@ -750,7 +754,16 @@
   
   def getResourceManagerPtr(self):
     return self.resourcemanager_ptr
-      
+
+  def getResourceByName(self, name):
+    resources = self.resources_ptr.getChildren()
+    res = filter(lambda x: x.getName() == name, resources)
+    if not res or len(res) < 1:
+      raise KeyError, name
+    if len(res) > 1:
+      raise Exception, 'More than one resource is named "%s"' % name
+    return res[0]
+
   def getClusterNodesPtr(self):
     return self.clusternodes_ptr
         



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cluster-devel] conga/luci/site/luci/Extensions/ClusterModel M ...
@ 2007-07-26  5:57 rmccabe
  0 siblings, 0 replies; 6+ messages in thread
From: rmccabe @ 2007-07-26  5:57 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2007-07-26 05:57:42

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

Log message:
	Part of fixes for 249086 missed in the previous commit

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.2&r2=1.1.4.3

--- conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py	2007/06/25 19:10:55	1.1.4.2
+++ conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py	2007/07/26 05:57:42	1.1.4.3
@@ -48,7 +48,6 @@
 from FailoverDomains import FailoverDomains
 from FailoverDomainNode import FailoverDomainNode
 from Rm import Rm
-from GeneralError import GeneralError
 
 DLM_TYPE	= 0
 GULM_TYPE	= 1
@@ -563,7 +562,7 @@
       if svc.getName() == name:
         return svc
 
-    raise GeneralError('FATAL', "Couldn't find service name in current list")
+    raise KeyError, 'Couldn\'t find service name %s in current list' % name
 
   def retrieveVMsByName(self, name):
     vms = self.getVMs()
@@ -571,7 +570,7 @@
       if v.getName() == name:
         return v
 
-    raise GeneralError('FATAL', "Couldn't find VM name %s in current list" % name)
+    raise KeyError, 'Couldn\'t find VM name %s in current list' % name
 
   def del_totem(self):
     if self.TOTEM_ptr is not None:



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cluster-devel] conga/luci/site/luci/Extensions/ClusterModel M ...
@ 2007-08-28 16:57 rmccabe
  0 siblings, 0 replies; 6+ messages in thread
From: rmccabe @ 2007-08-28 16:57 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL4
Changes by:	rmccabe at sourceware.org	2007-08-28 16:57:57

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

Log message:
	Cleanups from the -RHEL5 branch

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

--- conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py	2007/08/24 21:55:43	1.5.2.3
+++ conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py	2007/08/28 16:57:56	1.5.2.4
@@ -929,11 +929,11 @@
       self.isModified = True
 
   def set_nodes_multicast(self, mcast_addr, mcast_if=None):
-    for node in iter(self.getNodes()):
+    for node in self.getNodes():
       new_mcast_tag = True
       mcast = None
 
-      for node_child in iter(node.getChildren()):
+      for node_child in node.getChildren():
         if node_child.getTagName() == MCAST_STR:
           mcast = node_child
           new_mcast_tag = False
@@ -980,8 +980,8 @@
     self.isModified = True
 
   def del_nodes_multicast(self):
-    for node in iter(self.getNodes()):
-      for node_child in iter(node.getChildren()):
+    for node in self.getNodes():
+      for node_child in node.getChildren():
         if node_child.getTagName() == MCAST_STR:
           node.removeChild(node_child)
           break
@@ -990,7 +990,7 @@
     if self.CMAN_ptr is None:
       return False
 
-    for child in iter(self.CMAN_ptr.getChildren()):
+    for child in self.CMAN_ptr.getChildren():
       if child.getTagName() == MCAST_STR:
         self.CMAN_ptr.removeChild(child)
 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cluster-devel] conga/luci/site/luci/Extensions/ClusterModel M ...
@ 2007-09-11 19:04 rmccabe
  0 siblings, 0 replies; 6+ messages in thread
From: rmccabe @ 2007-09-11 19:04 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2007-09-11 19:04:32

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

Log message:
	Make the model recognize the 'altname' tag for proper configuration of multi-homed nodes

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/Altname.py.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py.diff?cvsroot=cluster&r1=1.8&r2=1.9

/cvs/cluster/conga/luci/site/luci/Extensions/ClusterModel/Altname.py,v  -->  standard output
revision 1.1
--- conga/luci/site/luci/Extensions/ClusterModel/Altname.py
+++ -	2007-09-11 19:04:33.148571000 +0000
@@ -0,0 +1,15 @@
+# Copyright (C) 2007 Red Hat, Inc.
+#
+# This program is free software; you can redistribute
+# it and/or modify it under the terms of version 2 of the
+# GNU General Public License as published by the
+# Free Software Foundation.
+
+from TagObject import TagObject
+
+TAG_NAME = 'altname'
+
+class Altname(TagObject):
+  def __init__(self):
+    TagObject.__init__(self)
+    self.TAG_NAME = TAG_NAME
--- conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py	2007/09/11 16:04:34	1.8
+++ conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py	2007/09/11 19:04:32	1.9
@@ -48,6 +48,7 @@
 from FailoverDomains import FailoverDomains
 from FailoverDomainNode import FailoverDomainNode
 from Rm import Rm
+from Altname import Altname
 
 DLM_TYPE	= 0
 GULM_TYPE	= 1
@@ -55,6 +56,7 @@
 TAGNAMES = { 'cluster': Cluster,
              'clusternodes': ClusterNodes,
              'clusternode': ClusterNode,
+             'altname': Altname,
              'fence': Fence,
              'fencedevice': FenceDevice,
              'fencedevices': FenceDevices,



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cluster-devel] conga/luci/site/luci/Extensions/ClusterModel M ...
@ 2009-01-22 20:35 rmccabe
  0 siblings, 0 replies; 6+ messages in thread
From: rmccabe @ 2009-01-22 20:35 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at 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



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cluster-devel] conga/luci/site/luci/Extensions/ClusterModel M ...
@ 2009-01-22 21:31 rmccabe
  0 siblings, 0 replies; 6+ messages in thread
From: rmccabe @ 2009-01-22 21:31 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at 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=RHEL5&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



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-01-22 21:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-08 21:31 [Cluster-devel] conga/luci/site/luci/Extensions/ClusterModel M rmccabe
  -- strict thread matches above, loose matches on Subject: below --
2007-07-26  5:57 rmccabe
2007-08-28 16:57 rmccabe
2007-09-11 19:04 rmccabe
2009-01-22 20:35 rmccabe
2009-01-22 21:31 rmccabe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).