All of lore.kernel.org
 help / color / mirror / Atom feed
From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/luci cluster/form-macros site/luci/Exten ...
Date: 7 Feb 2007 16:55:16 -0000	[thread overview]
Message-ID: <20070207165516.20103.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2007-02-07 16:55:16

Modified files:
	luci/cluster   : form-macros 
	luci/site/luci/Extensions: ModelBuilder.py cluster_adapters.py 
Added files:
	luci/site/luci/Extensions: FenceXVMd.py 

Log message:
	- Support for adding and deleting a fence_xvmd tag from cluster.conf

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.177&r2=1.178
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/FenceXVMd.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.20&r2=1.21
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.229&r2=1.230

--- conga/luci/cluster/form-macros	2007/02/05 19:52:44	1.177
+++ conga/luci/cluster/form-macros	2007/02/07 16:55:15	1.178
@@ -943,6 +943,13 @@
 							tal:attributes="value clusterinfo/pjd" />
 					</td>
 				</tr>
+				<tr class="systemsTable">
+					<td class="systemsTable">Run XVM fence daemon</td>
+					<td class="systemsTable">
+						<input type="checkbox" name="run_xvmd"
+							tal:attributes="checked python: ('fence_xvmd' in clusterinfo and clusterinfo['fence_xvmd']) and 'checked' or ''" />
+					</td>
+				</tr>
 			</tbody>
 
 			<tfoot class="systemsTable">
/cvs/cluster/conga/luci/site/luci/Extensions/FenceXVMd.py,v  -->  standard output
revision 1.1
--- conga/luci/site/luci/Extensions/FenceXVMd.py
+++ -	2007-02-07 16:55:16.669210000 +0000
@@ -0,0 +1,14 @@
+import string
+from TagObject import TagObject
+
+TAG_NAME = "fence_xvmd"
+
+class FenceXVMd(TagObject):
+  def __init__(self):
+    TagObject.__init__(self)
+    self.TAG_NAME = TAG_NAME
+    #Have autostart set by default
+
+  def getProperties(self):
+    stringbuf = ""
+    return stringbuf
--- conga/luci/site/luci/Extensions/ModelBuilder.py	2007/02/05 19:52:44	1.20
+++ conga/luci/site/luci/Extensions/ModelBuilder.py	2007/02/07 16:55:15	1.21
@@ -27,6 +27,7 @@
 from Samba import Samba
 from Multicast import Multicast
 from FenceDaemon import FenceDaemon
+from FenceXVMd import FenceXVMd
 from Netfs import Netfs
 from Clusterfs import Clusterfs
 from Resources import Resources
@@ -56,6 +57,7 @@
            'rm':Rm,
            'service':Service,
            'vm':Vm,
+           'fence_xvmd':FenceXVMd,
            'resources':Resources,
            'failoverdomain':FailoverDomain,
            'failoverdomains':FailoverDomains,
@@ -85,6 +87,7 @@
 FENCEDAEMON_PTR_STR="fence_daemon"
 SERVICE="service"
 VM="vm"
+FENCE_XVMD_STR="fence_xvmd"
 GULM_TAG_STR="gulm"
 MCAST_STR="multicast"
 CMAN_PTR_STR="cman"
@@ -119,6 +122,7 @@
     self.isModified = False
     self.quorumd_ptr = None
     self.usesQuorumd = False
+    self.fence_xvmd_ptr = None
     self.unusual_items = list()
     self.isVirtualized = False
     if mcast_addr == None:
@@ -217,6 +221,8 @@
         self.CMAN_ptr = new_object
       elif parent_node.nodeName == MCAST_STR:
         self.usesMulticast = True
+      elif parent_node.nodeName == FENCE_XVMD_STR:
+        self.fence_xvmd_ptr = new_object
 
     else:
       return None
@@ -591,6 +597,22 @@
 
     raise GeneralError('FATAL',"Couldn't find VM name %s in current list" % name)
 
+  def hasFenceXVM(self):
+    return self.fence_xvmd_ptr is not None
+
+  # Right now the fence_xvmd tag is empty, but allow the object
+  # to be passed in case attributes are added in the future.
+  def addFenceXVM(self, obj):
+    if self.fence_xvmd_ptr is not None:
+      self.cluster_ptr.removeChild(self.fence_xvmd_ptr)
+    self.cluster_ptr.addChild(obj)
+    self.fence_xvmd_ptr = obj
+
+  def delFenceXVM(self):
+    if self.fence_xvmd_ptr is not None:
+      self.cluster_ptr.removeChild(self.fence_xvmd_ptr)
+      self.fence_xvmd_ptr = None
+
   def getFenceDevices(self):
     if self.fencedevices_ptr == None:
       return list()
--- conga/luci/site/luci/Extensions/cluster_adapters.py	2007/02/05 19:56:18	1.229
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2007/02/07 16:55:15	1.230
@@ -24,6 +24,7 @@
 from Tomcat5 import Tomcat5
 from OpenLDAP import OpenLDAP
 from Vm import Vm
+from FenceXVMd import FenceXVMd
 from Script import Script
 from Samba import Samba
 from QuorumD import QuorumD
@@ -1172,6 +1173,18 @@
 	except ValueError, e:
 		errors.append('Invalid post join delay: %s' % str(e))
 
+	run_xvmd = False
+	try:
+		run_xvmd = form.has_key('run_xvmd')
+	except:
+		pass
+
+	if run_xvmd is True and not model.hasFenceXVM():
+		fenceXVMd = FenceXVMd()
+		model.addFenceXVM(fenceXVMd)
+	elif not run_xvmd:
+		model.delFenceXVM()
+
 	try:
 		fd = model.getFenceDaemonPtr()
 		old_pj_delay = fd.getPostJoinDelay()
@@ -3513,6 +3526,7 @@
   #new cluster params - if rhel5
   #-------------
 
+  clumap['fence_xvmd'] = model.hasFenceXVM()
   gulm_ptr = model.getGULMPtr()
   if not gulm_ptr:
     #Fence Daemon Props



             reply	other threads:[~2007-02-07 16:55 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-07 16:55 rmccabe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-09-21  3:11 [Cluster-devel] conga/luci cluster/form-macros site/luci/Exten rmccabe
2007-06-19 15:54 rmccabe
2007-05-03 20:16 rmccabe
2007-03-15 16:41 rmccabe
2007-03-14 22:38 rmccabe
2007-03-14 22:37 rmccabe
2007-03-05 16:50 rmccabe
2007-03-05 16:50 rmccabe
2007-03-05 16:49 rmccabe
2007-02-15 22:44 rmccabe
2007-02-08  3:46 rmccabe
2007-02-07 17:02 rmccabe
2007-02-02  4:34 rmccabe
2007-02-02  0:11 rmccabe
2007-02-01 20:49 rmccabe
2007-01-31 23:36 rmccabe
2007-01-31  5:26 rmccabe
2007-01-23 13:53 rmccabe
2007-01-15 18:21 rmccabe
2007-01-11 19:11 rmccabe
2007-01-10 21:40 rmccabe
2007-01-06  3:29 rmccabe
2006-12-14 23:14 rmccabe
2006-12-14 18:22 rmccabe
2006-12-11 22:42 rmccabe
2006-12-11 21:51 rmccabe
2006-12-06 22:11 rmccabe
2006-12-06 21:16 rmccabe
2006-11-13 21:40 rmccabe
2006-11-12  2:10 rmccabe
2006-11-09 20:32 rmccabe
2006-11-03 22:48 rmccabe
2006-10-25  1:53 rmccabe
2006-10-25  1:11 rmccabe
2006-10-13 21:25 rmccabe
2006-08-03 18:36 shuennek
2006-07-21 14:49 rmccabe
2006-07-20 16:59 rmccabe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070207165516.20103.qmail@sourceware.org \
    --to=rmccabe@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.