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

[Cluster-devel] conga/luci/site/luci/Extensions cluster_adapte ...



CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe sourceware org	2006-11-20 23:32:43

Modified files:
	luci/site/luci/Extensions: cluster_adapters.py 
	                           ricci_communicator.py 

Log message:
	the domU code in ricci_communicator isn't needed anymore

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.120.2.10&r2=1.120.2.11
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_communicator.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.9.2.5&r2=1.9.2.6

--- conga/luci/site/luci/Extensions/cluster_adapters.py	2006/11/17 05:50:09	1.120.2.10
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2006/11/20 23:32:43	1.120.2.11
@@ -588,19 +588,15 @@
 	except ValueError, e:
 		errors.append('An invalid Minimum Score value was given: %s' % str(e))
 
+  device = None
+  label = None  #Either device or label must be present
 	try:
 		device = form['device'].strip()
-		if not device:
-			raise KeyError, 'device is none'
-	except KeyError, e:
-		errors.append('No Device value was given')
-
-	try:
 		label = form['label'].strip()
-		if not label:
-			raise KeyError, 'label is none'
+		if not device and not label:
+			raise KeyError, 'device and label are both none'
 	except KeyError, e:
-		errors.append('No Label value was given')
+		errors.append('No Device or Label value was given')
 
 	num_heuristics = 0
 	try:
@@ -655,6 +651,26 @@
 
 	if len(errors) > 0:
 		return (False, {'errors': errors })
+
+  qd = QuorumD()
+  qd.addAttribute('interval', interval)
+  qd.addAttribute('votes', votes)
+  qd.addAttribute('tko', tko)
+  qd.addAttribute('min_score', min_score)
+  if device:
+    qd.addAttribute('device', device)
+  else:
+    qd.addAttribute('label', label)
+  cp = model.getClusterPtr()
+  cp.addChild(qd)
+
+  for h in heuristics:
+    new_h = Heuristic()
+    new_h.addAttribute('program', h[1])
+    new_h.addAttribute('interval', h[2])
+    new_h.addAttribute('score', h[3])
+    qd.addChild(new_h)
+
 	return (True, {'messages': ['Changes accepted. - FILL ME IN']})
 
 def validateGeneralConfig(model, form):
--- conga/luci/site/luci/Extensions/ricci_communicator.py	2006/11/20 22:12:06	1.9.2.5
+++ conga/luci/site/luci/Extensions/ricci_communicator.py	2006/11/20 23:32:43	1.9.2.6
@@ -62,7 +62,6 @@
         self.__reported_hostname = hello.firstChild.getAttribute('hostname')
         self.__os = hello.firstChild.getAttribute('os')
         self.__dom0 = hello.firstChild.getAttribute('xen_host') == 'true'
-        self.__domU = hello.firstChild.getAttribute('xen_guest') == 'true'
 
         pass
     
@@ -91,11 +90,6 @@
         luci_log.debug_verbose('RC:dom0: [auth %d] reported system_name = %s for %s' \
             % (self.__authed, self.__dom0, self.__hostname))
         return self.__dom0
-    def domU(self):
-        luci_log.debug_verbose('RC:domU: [auth %d] reported system_name = %s for %s' \
-            % (self.__authed, self.__domU, self.__hostname))
-        return self.__domU
-    
     
     def auth(self, password):
         if self.authed():
@@ -364,8 +358,6 @@
     return ricci.os()
 def ricci_get_dom0(self, ricci):
     return ricci.dom0()
-def ricci_get_domU(self, ricci):
-    return ricci.domU()
 def ricci_get_cluster_info(self, ricci):
     return ricci.cluster_info()
 def ricci_get_authenticated(self, ricci):


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