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: 23 Jan 2007 13:53:37 -0000	[thread overview]
Message-ID: <20070123135337.29306.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2007-01-23 13:53:36

Modified files:
	luci/cluster   : form-macros 
	luci/site/luci/Extensions: Ip.py cluster_adapters.py 
	                           conga_constants.py 

Log message:
	GULM support for RHEL4 clusters.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.157&r2=1.158
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/Ip.py.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.209&r2=1.210
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_constants.py.diff?cvsroot=cluster&r1=1.34&r2=1.35

--- conga/luci/cluster/form-macros	2007/01/22 21:18:58	1.157
+++ conga/luci/cluster/form-macros	2007/01/23 13:53:35	1.158
@@ -2828,7 +2828,13 @@
 				<span tal:attributes="class python: 'cluster node ' + status_class"
 					tal:content="python: cluster_node_status_str" />
 			</td>
+		</tr>
 
+		<tr class="cluster node info_middle"
+			tal:condition="nodeinfo/gulm_lockserver">
+			<td class="cluster node node_status" colspan="2">
+				This node is a GULM lock server.
+			</td>
 		</tr>
 
 		<tr class="cluster node info_bottom"
@@ -3230,6 +3236,13 @@
 				</td>
 			</tr>
 
+			<tr class="node info_middle"
+				tal:condition="nd/gulm_lockserver">
+				<td class="node node_status" colspan="2">
+					This node is a GULM lock server.
+				</td>
+			</tr>
+
 			<tr class="node info_bottom">
 				<td class="node node_services">
 					<strong class="cluster node">Services on this Node:</strong>
--- conga/luci/site/luci/Extensions/Ip.py	2006/05/30 20:17:21	1.1
+++ conga/luci/site/luci/Extensions/Ip.py	2007/01/23 13:53:36	1.2
@@ -6,7 +6,7 @@
 _ = gettext.gettext
 
 TAG_NAME = "ip"
-RESOURCE_TYPE=_("IP Address: ")
+RESOURCE_TYPE=_("IP Address")
 
 class Ip(BaseResource):
   def __init__(self):
--- conga/luci/site/luci/Extensions/cluster_adapters.py	2007/01/22 17:06:48	1.209
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2007/01/23 13:53:36	1.210
@@ -16,6 +16,7 @@
 from NFSClient import NFSClient
 from NFSExport import NFSExport
 from Service import Service
+from Lockserver import Lockserver
 from Netfs import Netfs
 from Apache import Apache
 from MySQL import MySQL
@@ -1136,11 +1137,32 @@
 
 	return (True, {})
 
+def validateGULMConfig(model, form):
+	gulm_ptr = model.getGULMPtr()
+	if not gulm_ptr:
+		return (False, {'errors': [ 'This cluster appears not to be using GULM locking.' ]})
+	node_list = map(lambda x: x.getName(), model.getNodes())
+
+	gulm_lockservers = list()
+	for node in node_list:
+		if form.has_key(node) and form[node] == 'on':
+			ls = Lockserver()
+			ls.addAttribute('name', node)
+			gulm_lockservers.append(ls)
+
+	num_ls = len(gulm_lockservers)
+	if not num_ls in (1, 3, 4, 5):
+		return (False, {'errors': [ 'You must have exactly 1, 3, 4, or 5 GULM lock servers. You selected %d nodes as lock servers.' % num_ls ]})
+
+	model.GULM_ptr.children = gulm_lockservers
+	return (True, {})
+
 configFormValidators = {
 	'general': validateGeneralConfig,
 	'mcast': validateMCastConfig,
 	'fence': validateFenceConfig,
-	'qdisk': validateQDiskConfig
+	'qdisk': validateQDiskConfig,
+	'gulm': validateGULMConfig
 }
 
 def validateConfigCluster(self, request):
@@ -3331,6 +3353,22 @@
     clumap['mcast_addr'] = "1.2.3.4"
 
   #-------------
+  #GULM params (rhel4 only)
+  gulm_ptr = model.getGULMPtr()
+  if gulm_ptr:
+    lockserv_list = list()
+    clunodes = model.getNodes()
+    gulm_lockservs = map(lambda x: x.getName(), gulm_ptr.getChildren())
+    for node in clunodes:
+      n = node.getName()
+      lockserv_list.append((n, n in gulm_lockservs))
+    clumap['gulm'] = True
+    clumap['gulm_url'] = prop_baseurl + PROPERTIES_TAB + '=' + PROP_GULM_TAB
+    clumap['gulm_lockservers'] = lockserv_list
+  else:
+    clumap['gulm'] = False
+
+  #-------------
   #quorum disk params
   quorumd_url = prop_baseurl + PROPERTIES_TAB + "=" + PROP_QDISK_TAB
   clumap['quorumd_url'] = quorumd_url
@@ -3569,18 +3607,18 @@
 			rc = RicciCommunicator(nodename_resolved)
 		except Exception, e:
 			luci_log.debug_verbose('CStop0: [%d] RC %s: %s' \
-				% (delete, nodename_resolved, str(e)))
+				% (delete is True, str(nodename_resolved), str(e)))
 			errors += 1
 			continue
 
 		if delete is True:
 			if nodeDelete(self, rc, model, clustername, nodename, nodename_resolved, delete_cluster=True) is None:
-				luci_log.debug_verbose('CStop1: nodeDelete failed')
+				luci_log.debug_verbose('CStop1: [1] nodeDelete failed')
 				errors += 1
 		else:
 			if nodeLeave(self, rc, clustername, nodename_resolved) is None:
-				luci_log.debug_verbose('CStop2: nodeLeave %s' \
-					% (delete, nodename_resolved))
+				luci_log.debug_verbose('CStop2: [0] nodeLeave %s' \
+					% (nodename_resolved))
 				errors += 1
 	return errors
 
@@ -4026,6 +4064,7 @@
 
   fdom_dict_list = list()
   if model:
+    infohash['gulm_lockserver'] = model.isNodeLockserver(nodename)
     #next is faildoms
     fdoms = model.getFailoverDomainsForNode(nodename)
     for fdom in fdoms:
@@ -4034,6 +4073,8 @@
       fdomurl = baseurl + "?" + PAGETYPE + "=" + FDOM_CONFIG + "&" + CLUNAME + "=" + clustername + "&fdomname=" + fdom.getName()
       fdom_dict['fdomurl'] = fdomurl
       fdom_dict_list.append(fdom_dict)
+  else:
+    infohash['gulm_lockserver'] = False
 
   infohash['fdoms'] = fdom_dict_list
 
@@ -4104,6 +4145,8 @@
     map = {}
     name = item['name']
     map['nodename'] = name
+    map['gulm_lockserver'] = model.isNodeLockserver(name)
+
     try:
       baseurl = req['URL']
     except:
--- conga/luci/site/luci/Extensions/conga_constants.py	2007/01/11 22:49:42	1.34
+++ conga/luci/site/luci/Extensions/conga_constants.py	2007/01/23 13:53:36	1.35
@@ -73,6 +73,7 @@
 PROP_FENCE_TAB = '2'
 PROP_MCAST_TAB = '3'
 PROP_QDISK_TAB = '4'
+PROP_GULM_TAB = '5'
 
 PAGETYPE="pagetype"
 ACTIONTYPE="actiontype"



             reply	other threads:[~2007-01-23 13:53 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-23 13:53 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-07 16:55 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-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=20070123135337.29306.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.