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

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



CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	jparsons sourceware org	2006-07-20 21:36:34

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

Log message:
	Added support for new conf tags. also added new method to export the model as a string.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ModelBuilder.py.diff?cvsroot=cluster&r1=1.2&r2=1.3

--- conga/luci/site/luci/Extensions/ModelBuilder.py	2006/05/31 17:58:53	1.2
+++ conga/luci/site/luci/Extensions/ModelBuilder.py	2006/07/20 21:36:34	1.3
@@ -24,6 +24,7 @@
 from NFSClient import NFSClient
 from NFSExport import NFSExport
 from Fs import Fs
+from Samba import Samba
 from Multicast import Multicast
 from FenceDaemon import FenceDaemon
 from Netfs import Netfs
@@ -36,6 +37,8 @@
 from FailoverDomains import FailoverDomains
 from FailoverDomainNode import FailoverDomainNode
 from Rm import Rm
+from Quorumd import Quorumd
+from Heuristic import Heuristic
 from CommandHandler import CommandHandler
 from CommandError import CommandError
 from GeneralError import GeneralError
@@ -52,6 +55,8 @@
            'gulm':Gulm,
            'lockserver':Lockserver,
            'rm':Rm,
+           'quorumd':Quorumd,
+           'heuristic':Heuristic,
            'service':Service,
            'xenvm':Xenvm,
            'resources':Resources,
@@ -60,6 +65,7 @@
            'failoverdomainnode':FailoverDomainNode,
            'ip':Ip,
            'fs':Fs,
+           'smb':Samba,
            'fence_daemon':FenceDaemon,
            'multicast':Multicast,
            'clusterfs':Clusterfs,
@@ -83,6 +89,7 @@
 GULM_TAG_STR="gulm"
 MCAST_STR="multicast"
 CMAN_PTR_STR="cman"
+QUORUMD_PTR_STR="quorumd"
 ###-----------------------------------
 
 
@@ -112,6 +119,8 @@
     self.fence_daemon_ptr = None
     self.command_handler = CommandHandler()
     self.isModified = False
+    self.quorumd_ptr = None
+    self.isQuorumd = False
     if mcast_addr == None:
       self.usesMulticast = False
     else:
@@ -183,6 +192,9 @@
         self.resources_ptr = new_object
       elif parent_node.nodeName == FENCEDAEMON_PTR_STR:
         self.fence_daemon_ptr = new_object
+      elif parent_node.nodeName == QUORUMD_PTR_STR:
+        self.quorumd_ptr = new_object
+        self.isQuorumd = True
       elif parent_node.nodeName == GULM_TAG_STR:
         self.GULM_ptr = new_object
         self.lock_type = GULM_TYPE
@@ -402,6 +414,30 @@
 
     return True
   
+  def exportModelAsString(self, strbuf):
+    if self.perform_final_check() == False: # failed
+      return False
+    
+    #check for dual power fences
+    self.dual_power_fence_check()
+
+    try:
+
+      doc = minidom.Document()
+      self.object_tree.generateXML(doc)
+      strbuf = doc.toprettyxml()
+
+      self.isModified = False
+
+    finally:
+      #dual_power_fence_check() adds extra
+      #fence instance entries for dual power controllers
+      #These must be removed from the tree before the UI
+      #can be used
+      self.purgePCDuplicates()
+
+    return True
+  
   def has_filepath(self):
     if self.filename == None:
       return False


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