[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] conga/luci/site/luci/Extensions ModelBuilder.p ...



CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe sourceware org	2007-02-15 18:55:36

Modified files:
	luci/site/luci/Extensions: ModelBuilder.py 
Added files:
	luci/site/luci/Extensions: Totem.py 

Log message:
	Add explicit support for the totem cluster.conf tag

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/Totem.py.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ModelBuilder.py.diff?cvsroot=cluster&r1=1.22&r2=1.23

/cvs/cluster/conga/luci/site/luci/Extensions/Totem.py,v  -->  standard output
revision 1.1
--- conga/luci/site/luci/Extensions/Totem.py
+++ -	2007-02-15 18:55:37.264108000 +0000
@@ -0,0 +1,9 @@
+import string
+from TagObject import TagObject
+
+TAG_NAME = "totem"
+
+class Totem(TagObject):
+  def __init__(self):
+    TagObject.__init__(self)
+    self.TAG_NAME = TAG_NAME 
--- conga/luci/site/luci/Extensions/ModelBuilder.py	2007/02/08 02:34:36	1.22
+++ conga/luci/site/luci/Extensions/ModelBuilder.py	2007/02/15 18:55:34	1.23
@@ -17,6 +17,7 @@
 from Method import Method
 from Device import Device
 from Cman import Cman
+from Totem import Totem
 from Gulm import Gulm
 from Lockserver import Lockserver
 from Ip import Ip
@@ -52,6 +53,7 @@
            'fencedevices':FenceDevices,
            'method':Method,
            'cman':Cman,
+           'totem':Totem,
            'gulm':Gulm,
            'lockserver':Lockserver,
            'rm':Rm,
@@ -91,6 +93,7 @@
 GULM_TAG_STR="gulm"
 MCAST_STR="multicast"
 CMAN_PTR_STR="cman"
+TOTEM_PTR_STR="totem"
 QUORUMD_PTR_STR="quorumd"
 ###-----------------------------------
 
@@ -113,6 +116,7 @@
     self.cluster_ptr = None
     self.GULM_ptr = None
     self.CMAN_ptr = None
+    self.TOTEM_ptr = None
     self.clusternodes_ptr = None
     self.failoverdomains_ptr = None
     self.fencedevices_ptr = None
@@ -219,6 +223,8 @@
         self.lock_type = GULM_TYPE
       elif parent_node.nodeName == CMAN_PTR_STR:
         self.CMAN_ptr = new_object
+      elif parent_node.nodeName == TOTEM_PTR_STR:
+        self.TOTEM_ptr = new_object
       elif parent_node.nodeName == MCAST_STR:
         self.usesMulticast = True
       elif parent_node.nodeName == FENCE_XVMD_STR:
@@ -597,6 +603,17 @@
 
     raise GeneralError('FATAL',"Couldn't find VM name %s in current list" % name)
 
+  def del_totem(self):
+    if self.TOTEM_ptr is not None:
+      self.cluster_ptr.removeChild(self.TOTEM_ptr)
+      self.TOTEM_ptr = None
+
+  def add_totem(self, obj):
+    self.del_totem()
+    if self.TOTEM_ptr is None:
+      self.cluster_ptr.addChild(obj)
+      self.TOTEM_ptr = obj
+
   def hasFenceXVM(self):
     return self.fence_xvmd_ptr is not None
 
@@ -839,6 +856,8 @@
     if self.lock_type == DLM_TYPE:
       #remove <cman>
       self.cluster_ptr.removeChild(self.CMAN_ptr)
+      if self.TOTEM_ptr is not None:
+        self.del_totem()
       self.CMAN_ptr = None
 
       #add gulm tag


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]