cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-10-23 19:31 jparsons
  0 siblings, 0 replies; 31+ messages in thread
From: jparsons @ 2006-10-23 19:31 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	jparsons at sourceware.org	2006-10-23 19:31:16

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

Log message:
	Fix for bz 211370

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_bridge.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.30&r2=1.30.2.1

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/16 20:56:09	1.30
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/23 19:31:15	1.30.2.1
@@ -281,7 +281,7 @@
 def getNodeLogs(rc):
 	errstr = 'log not accessible'
 
-	batch_str = '<module name="log"><request sequence="1254" API_version="1.0"><function_call name="get"><var mutable="false" name="age" type="int" value="360000"/><var mutable="false" name="tags" type="list_str"><listentry value="cluster"/></var></function_call></request></module>'
+	batch_str = '<module name="log"><request sequence="1254" API_version="1.0"><function_call name="get"><var mutable="false" name="age" type="int" value="18000"/><var mutable="false" name="tags" type="list_str"><listentry value="cluster"/></var></function_call></request></module>'
 
 	ricci_xml = rc.batch_run(batch_str, async=False)
 	doc = getPayload(ricci_xml)



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2007-03-21 17:18 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2007-03-21 17:18 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2007-03-21 17:18:06

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

Log message:
	Set the default post join delay for non-rhel4 clusters to 12s.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_bridge.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.30.2.19&r2=1.30.2.20

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2007/03/12 04:22:26	1.30.2.19
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2007/03/21 17:18:06	1.30.2.20
@@ -119,7 +119,12 @@
 	batch += '<var mutable="false" name="propagate" type="boolean" value="false"/>'
 	batch += '<var mutable="false" name="cluster.conf" type="xml">'
 	batch += '<cluster config_version="1" name="' + cluster_name + '">'
-	batch += '<fence_daemon post_fail_delay="0" post_join_delay="3"/>'
+
+	if os_str == 'rhel4':
+		batch += '<fence_daemon post_fail_delay="0" post_join_delay="3"/>'
+	else:
+		batch += '<fence_daemon post_fail_delay="0" post_join_delay="12"/>'
+
 	batch += '<clusternodes/>'
 	batch += '<cman/>'
 	batch += '<fencedevices/>'
@@ -232,7 +237,12 @@
 	batch += '<var mutable="false" name="propagate" type="boolean" value="false"/>'
 	batch += '<var mutable="false" name="cluster.conf" type="xml">'
 	batch += '<cluster config_version="1" name="' + cluster_name + '" alias="' + cluster_alias + '">'
-	batch += '<fence_daemon post_fail_delay="0" post_join_delay="3"/>'
+
+	if os_str == 'rhel4':
+		batch += '<fence_daemon post_fail_delay="0" post_join_delay="3"/>'
+	else:
+		batch += '<fence_daemon post_fail_delay="0" post_join_delay="12"/>'
+
 	batch += '<clusternodes>'
 	x = 1
 	for i in nodeList:



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2007-03-21 17:16 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2007-03-21 17:16 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL4
Changes by:	rmccabe at sourceware.org	2007-03-21 17:16:51

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

Log message:
	Set the default post join delay for non-rhel4 clusters to 12s.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_bridge.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.56.2.5&r2=1.56.2.6

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2007/03/12 04:24:34	1.56.2.5
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2007/03/21 17:16:51	1.56.2.6
@@ -119,7 +119,12 @@
 	batch += '<var mutable="false" name="propagate" type="boolean" value="false"/>'
 	batch += '<var mutable="false" name="cluster.conf" type="xml">'
 	batch += '<cluster config_version="1" name="' + cluster_name + '">'
-	batch += '<fence_daemon post_fail_delay="0" post_join_delay="3"/>'
+
+	if os_str == 'rhel4':
+		batch += '<fence_daemon post_fail_delay="0" post_join_delay="3"/>'
+	else:
+		batch += '<fence_daemon post_fail_delay="0" post_join_delay="12"/>'
+
 	batch += '<clusternodes/>'
 	batch += '<cman/>'
 	batch += '<fencedevices/>'
@@ -232,7 +237,12 @@
 	batch += '<var mutable="false" name="propagate" type="boolean" value="false"/>'
 	batch += '<var mutable="false" name="cluster.conf" type="xml">'
 	batch += '<cluster config_version="1" name="' + cluster_name + '" alias="' + cluster_alias + '">'
-	batch += '<fence_daemon post_fail_delay="0" post_join_delay="3"/>'
+
+	if os_str == 'rhel4':
+		batch += '<fence_daemon post_fail_delay="0" post_join_delay="3"/>'
+	else:
+		batch += '<fence_daemon post_fail_delay="0" post_join_delay="12"/>'
+
 	batch += '<clusternodes>'
 	x = 1
 	for i in nodeList:



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2007-03-21 17:14 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2007-03-21 17:14 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2007-03-21 17:14:23

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

Log message:
	Make the default post join delay for non-rhel4 clusters 12s.

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2007/03/12 04:25:41	1.61
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2007/03/21 17:14:23	1.62
@@ -119,7 +119,12 @@
 	batch += '<var mutable="false" name="propagate" type="boolean" value="false"/>'
 	batch += '<var mutable="false" name="cluster.conf" type="xml">'
 	batch += '<cluster config_version="1" name="' + cluster_name + '">'
-	batch += '<fence_daemon post_fail_delay="0" post_join_delay="3"/>'
+
+	if os_str == 'rhel4':
+		batch += '<fence_daemon post_fail_delay="0" post_join_delay="3"/>'
+	else:
+		batch += '<fence_daemon post_fail_delay="0" post_join_delay="12"/>'
+
 	batch += '<clusternodes/>'
 	batch += '<cman/>'
 	batch += '<fencedevices/>'
@@ -232,7 +237,12 @@
 	batch += '<var mutable="false" name="propagate" type="boolean" value="false"/>'
 	batch += '<var mutable="false" name="cluster.conf" type="xml">'
 	batch += '<cluster config_version="1" name="' + cluster_name + '" alias="' + cluster_alias + '">'
-	batch += '<fence_daemon post_fail_delay="0" post_join_delay="3"/>'
+
+	if os_str == 'rhel4':
+		batch += '<fence_daemon post_fail_delay="0" post_join_delay="3"/>'
+	else:
+		batch += '<fence_daemon post_fail_delay="0" post_join_delay="12"/>'
+
 	batch += '<clusternodes>'
 	x = 1
 	for i in nodeList:



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2007-03-01  0:40 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2007-03-01  0:40 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL4
Changes by:	rmccabe at sourceware.org	2007-03-01 00:40:53

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

Log message:
	Revert services patch from HEAD

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_bridge.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.56.2.3&r2=1.56.2.4

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2007/03/01 00:39:18	1.56.2.3
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2007/03/01 00:40:53	1.56.2.4
@@ -486,85 +486,6 @@
 	ricci_xml = rc.batch_run(batch_str)
 	return batchAttemptResult(ricci_xml)
 
-def svc_manage(rc, hostname, servicename, op):
-	svc_func = None
-
-	doc = minidom.Document()
-	elem = doc.createElement('result')
-	elem.setAttribute('success', '0')
-
-	if not servicename:
-		elem.setAttribute('service', 'No service name was specified.')
-		elem.setAttribute('message', 'No service name was specified.')
-
-	if not op:
-		elem.setAttribute('operation', 'No operation was specified.')
-		elem.setAttribute('message', 'No operation was specified.')
-
-	if not servicename or not op:
-		doc.appendChild(elem)
-		return doc
-
-	elem.setAttribute('service', servicename)
-	elem.setAttribute('operation', op)
-	elem.setAttribute('hostname', hostname)
-
-	try:
-		op = op.strip().lower()
-		if op == 'restart' or op == 'start' or op == 'stop':
-			svc_func = op
-		else:
-			raise Exception, op
-	except Exception, e:
-		elem.setAttribute('message', 'Unknown operation: %s' % str(e))
-		doc.appendChild(elem)
-		return doc
-
-	batch_str = '<module name="service"><request API_version="1.0"><function_call name="%s"><var mutable="false" name="services" type="list_xml"><service name="%s"/></var></function_call></request></module>' % (svc_func, servicename)
-		
-	ricci_xml = rc.batch_run(batch_str, async=False)
-	if not ricci_xml or not ricci_xml.firstChild:
-		elem.setAttribute('message', 'operation failed')
-		doc.appendChild(elem)
-		return doc
-
-	try:
-		mod_elem = ricci_xml.getElementsByTagName('module')
-		status_code = int(mod_elem[0].getAttribute('status'))
-		if status_code == 0:
-			var_elem = mod_elem[0].getElementsByTagName('var')
-			for i in var_elem:
-				name = i.getAttribute('name').lower()
-				if name == 'success':
-					success = i.getAttribute('value').lower()
-					if success == 'true':
-						elem.setAttribute('success', '1')
-						elem.setAttribute('message', 'success')
-					else:
-						elem.setAttribute('message', 'operation failed')
-					break
-		else:
-			err_msg = mod_elem[0].childNodes[1].getAttribute('description')
-			elem.setAttribute('message', err_msg)
-	except Exception, e:
-		elem.setAttribute('message', 'operation failed')
-
-	doc.appendChild(elem)
-	return doc
-
-def list_services(rc):
-	batch_str = '<module name="service"><request API_version="1.0"><function_call name="list"><var mutable="false" name="description" type="boolean" value="true"/></function_call></request></module>'
-	ricci_xml = rc.batch_run(batch_str, async=False)
-	if not ricci_xml or not ricci_xml.firstChild:
-		luci_log.debug_verbose('LS0: None returned')
-		return None
-	try:
-		service_tags = ricci_xml.getElementsByTagName('service')
-		return service_tags
-	except Exception, e:
-		luci_log.debug_verbose('LS1: %s' % str(e))
-	return None
-
 def nodeIsVirtual(rc):
 	batch_str = '<module name="cluster"><request API_version="1.0"><function_call name="virt_guest"/></request></module>'
 



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-12-12 19:03 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2006-12-12 19:03 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-12-12 19:03:06

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

Log message:
	fix a var use before declared error

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/12/12 13:11:50	1.50
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/12/12 19:03:06	1.51
@@ -38,8 +38,7 @@
 		return (True, 'completed sucessfully')
 
 	# Error
-	luci_log.debug_verbose('checkBatch2: %s: %s: %s' \
-		% (str(code), rc.hostname(), str(e)))
+	luci_log.debug_verbose('checkBatch2: %s: %s' % (str(code), rc.hostname()))
 	return (-1, err_msg)
 
 def addClusterNodeBatch(os_str,



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-12-10 19:19 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2006-12-10 19:19 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-12-10 19:19:32

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

Log message:
	change a '0' to 0 to avoid a spurious error message

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/12/08 23:02:49	1.48
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/12/10 19:19:32	1.49
@@ -16,7 +16,8 @@
 		batch = rc.batch_report(batch_id)
 		if batch is None:
 			return (True, 'batch id was not found')
-	except:
+	except Exception, e:
+		luci_log.debug_verbose('checkBatch0: %s: %s' % (rc.hostname(), str(e)))
 		return (-1, err_msg)
 
 	try:
@@ -24,7 +25,8 @@
 		if new_err_msg:
 			err_msg = 'A Ricci error occurred on %s: %s' \
 				% (rc.hostname(), str(new_err_msg))
-	except:
+	except Exception, e:
+		luci_log.debug_verbose('checkBatch1: %s: %s' % (rc.hostname(), str(e)))
 		return (-1, err_msg)
 
 	# In progress.
@@ -32,10 +34,12 @@
 		return (False, 'in progress')
 
 	# Done successfully.
-	if code == '0':
+	if code == 0:
 		return (True, 'completed sucessfully')
 
 	# Error
+	luci_log.debug_verbose('checkBatch2: %s: %s: %s' \
+		% (str(code), rc.hostname(), str(e)))
 	return (-1, err_msg)
 
 def addClusterNodeBatch(os_str,



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-11-20 23:36 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2006-11-20 23:36 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2006-11-20 23:36:13

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

Log message:
	return either true, false or none, depending on whether the node is virtual, not virtual, or we're unable to determine whether it's virtual, respectively

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_bridge.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.30.2.9&r2=1.30.2.10

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/11/20 23:30:47	1.30.2.9
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/11/20 23:36:12	1.30.2.10
@@ -508,9 +508,38 @@
 
 	ricci_xml = rc.batch_run(batch_str, async=False)
 	if not ricci_xml or not ricci_xml.firstChild:
-		luci_log.debug_verbose('no ricci_xml in nodeIsVirtual')
+		luci_log.debug_verbose('nodeIsVirtual0: None returned')
 		return None
-	return ricci_xml.firstChild
+
+	var_tags = ricci_xml.getElementsByTagName('var')
+	if not var_tags or len(var_tags) < 2:
+		luci_log.debug_verbose('nodeIsVirtual1: unexpected response %s' \
+			% ricci_xml.toxml())
+		return None
+
+	success = False
+	virtual = False
+	for i in var_tags:
+		try:
+			name = i.getAttribute('name')
+			if not name:
+				raise Exception, 'name is blank'
+			if name == 'success':
+				result = i.getAttribute('value')
+				if result == 'true':
+					success = True
+			elif name == 'virt_guest':
+				result = i.getAttribute('value')
+				if result == 'true':
+					virtual = True
+			else:
+				raise Exception, 'unexpected attribute name: %s' % name
+		except Exception, e:
+			luci_log.debug_verbose('nodeIsVirtual2: error: %s' % str(e))
+
+	if not success:
+		return None
+	return virtual
 
 def getDaemonStates(rc, dlist):
 	batch_str = '<module name="service"><request API_version="1.0"><function_call name="query"><var mutable="false" name="search" type="list_xml">'



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-11-20 23:30 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2006-11-20 23:30 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2006-11-20 23:30:47

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

Log message:
	return either true, false or none, depending on whether the node is virtual, not
	virtual, or we're unable to determine whether it's virtual, respectively

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_bridge.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.30.2.8&r2=1.30.2.9

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/11/16 20:22:17	1.30.2.8
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/11/20 23:30:47	1.30.2.9
@@ -503,6 +503,15 @@
 	ricci_xml = rc.batch_run(batch_str)
 	return batchAttemptResult(ricci_xml)
 
+def nodeIsVirtual(rc):
+	batch_str = '<module name="cluster"><request API_version="1.0"><function_call name="virt_guest"/></request></module>'
+
+	ricci_xml = rc.batch_run(batch_str, async=False)
+	if not ricci_xml or not ricci_xml.firstChild:
+		luci_log.debug_verbose('no ricci_xml in nodeIsVirtual')
+		return None
+	return ricci_xml.firstChild
+
 def getDaemonStates(rc, dlist):
 	batch_str = '<module name="service"><request API_version="1.0"><function_call name="query"><var mutable="false" name="search" type="list_xml">'
 



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-11-20 23:30 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2006-11-20 23:30 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-11-20 23:30:18

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

Log message:
	return either true, false or none, depending on whether the node is virtual, not virtual, or we're unable to determine whether it's virtual, respectively

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/11/20 23:10:57	1.45
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/11/20 23:30:17	1.46
@@ -508,9 +508,38 @@
 
 	ricci_xml = rc.batch_run(batch_str, async=False)
 	if not ricci_xml or not ricci_xml.firstChild:
-		luci_log.debug_verbose('no ricci_xml in nodeIsVirtual')
+		luci_log.debug_verbose('nodeIsVirtual0: None returned')
 		return None
-	return ricci_xml.firstChild
+
+	var_tags = ricci_xml.getElementsByTagName('var')
+	if not var_tags or len(var_tags) < 2:
+		luci_log.debug_verbose('nodeIsVirtual1: unexpected response %s' \
+			% ricci_xml.toxml())
+		return None
+
+	success = False
+	virtual = False
+	for i in var_tags:
+		try:
+			name = i.getAttribute('name')
+			if not name:
+				raise Exception, 'name is blank'
+			if name == 'success':
+				result = i.getAttribute('value')
+				if result == 'true':
+					success = True
+			elif name == 'virt_guest':
+				result = i.getAttribute('value')
+				if result == 'true':
+					virtual = True
+			else:
+				raise Exception, 'unexpected attribute name: %s' % name
+		except Exception, e:
+			luci_log.debug_verbose('nodeIsVirtual2: error: %s' % str(e))
+
+	if not success:
+		return None
+	return virtual
 
 def getDaemonStates(rc, dlist):
 	batch_str = '<module name="service"><request API_version="1.0"><function_call name="query"><var mutable="false" name="search" type="list_xml">'



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-11-16 20:22 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2006-11-16 20:22 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2006-11-16 20:22:17

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

Log message:
	fix brain damage that caused making no changes to daemon properties to cause an
	uncaught exception (related to bz# 215034)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_bridge.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.30.2.7&r2=1.30.2.8

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/11/16 19:34:53	1.30.2.7
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/11/16 20:22:17	1.30.2.8
@@ -487,7 +487,7 @@
 		batch += '</var></function_call></request></module>'
 
 	if batch == '':
-		return None
+		return None, None
 	ricci_xml = rc.batch_run(batch)
 	return batchAttemptResult(ricci_xml)
 	



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-11-16 20:20 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2006-11-16 20:20 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-11-16 20:20:50

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

Log message:
	fix brain damage that caused making no changes to daemon properties to cause an uncaught exception (related to bz# 215034)

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/11/13 21:40:55	1.43
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/11/16 20:20:49	1.44
@@ -487,7 +487,7 @@
 		batch += '</var></function_call></request></module>'
 
 	if batch == '':
-		return None
+		return None, None
 	ricci_xml = rc.batch_run(batch)
 	return batchAttemptResult(ricci_xml)
 	



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-10-31 13:51 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2006-10-31 13:51 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-10-31 13:51:54

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

Log message:
	fix non-async callers of batch_run to expect the first node to be '<?xml ...'

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/31 13:16:30	1.38
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/31 13:51:53	1.39
@@ -279,7 +279,10 @@
 	batch_str ='<module name="cluster"><request API_version="1.0"><function_call name="status"/></request></module>'
 	ricci_xml = rc.batch_run(batch_str, async=False)
 
-	doc = getPayload(ricci_xml)
+	if not ricci_xml or not ricci_xml.firstChild:
+		luci_log.debug_verbose('ricci_xml is None from batch_run')
+		
+	doc = getPayload(ricci_xml.firstChild)
 	if not doc or not doc.firstChild:
 		luci_log.debug_verbose('doc is None from getPayload: %s' % ricci_xml.toxml())
 		return None
@@ -419,9 +422,10 @@
 	batch_str += '</var></function_call></request></module>'
 
 	ricci_xml = rc.batch_run(batch_str, async=False)
-	if not ricci_xml:
+	if not ricci_xml or not ricci_xml.firstChild:
+		luci_log.debug_verbose('no ricci_xml in getDaemonStates')
 		return None
-	result = extractDaemonInfo(ricci_xml)
+	result = extractDaemonInfo(ricci_xml.firstChild)
 	return result
 
 def extractDaemonInfo(bt_node):



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-10-25 16:01 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2006-10-25 16:01 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-10-25 16:01:17

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

Log message:
	be less specific about what kind of log entries to return. we were asking only
	for cluster logs before, which could result in a user waiting more than 2 minute
	s and getting nothing back.

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/25 01:11:08	1.34
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/25 16:01:17	1.35
@@ -282,7 +282,7 @@
 def getNodeLogs(rc):
 	errstr = 'log not accessible'
 
-	batch_str = '<module name="log"><request sequence="1254" API_version="1.0"><function_call name="get"><var mutable="false" name="age" type="int" value="18000"/><var mutable="false" name="tags" type="list_str"><listentry value="cluster"/></var></function_call></request></module>'
+	batch_str = '<module name="log"><request sequence="1254" API_version="1.0"><function_call name="get"><var mutable="false" name="age" type="int" value="18000"/><var mutable="false" name="tags" type="list_str"></var></function_call></request></module>'
 
 	ricci_xml = rc.batch_run(batch_str, async=False)
 	if not ricci_xml:



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-10-25 16:00 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2006-10-25 16:00 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2006-10-25 16:00:41

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

Log message:
	be less specific about what kind of log entries to return. we were asking only
	for cluster logs before, which could result in a user waiting more than 2 minutes and getting nothing back.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_bridge.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.30.2.3&r2=1.30.2.4

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/25 01:53:34	1.30.2.3
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/25 16:00:40	1.30.2.4
@@ -282,7 +282,7 @@
 def getNodeLogs(rc):
 	errstr = 'log not accessible'
 
-	batch_str = '<module name="log"><request sequence="1254" API_version="1.0"><function_call name="get"><var mutable="false" name="age" type="int" value="18000"/><var mutable="false" name="tags" type="list_str"><listentry value="cluster"/></var></function_call></request></module>'
+	batch_str = '<module name="log"><request sequence="1254" API_version="1.0"><function_call name="get"><var mutable="false" name="age" type="int" value="18000"/><var mutable="false" name="tags" type="list_str"></var></function_call></request></module>'
 
 	ricci_xml = rc.batch_run(batch_str, async=False)
 	if not ricci_xml:



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-10-23 19:24 jparsons
  0 siblings, 0 replies; 31+ messages in thread
From: jparsons @ 2006-10-23 19:24 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	jparsons at sourceware.org	2006-10-23 19:24:39

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

Log message:
	Fix for bz 211370

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/20 22:29:22	1.31
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/23 19:24:39	1.32
@@ -281,7 +281,7 @@
 def getNodeLogs(rc):
 	errstr = 'log not accessible'
 
-	batch_str = '<module name="log"><request sequence="1254" API_version="1.0"><function_call name="get"><var mutable="false" name="age" type="int" value="360000"/><var mutable="false" name="tags" type="list_str"><listentry value="cluster"/></var></function_call></request></module>'
+	batch_str = '<module name="log"><request sequence="1254" API_version="1.0"><function_call name="get"><var mutable="false" name="age" type="int" value="18000"/><var mutable="false" name="tags" type="list_str"><listentry value="cluster"/></var></function_call></request></module>'
 
 	ricci_xml = rc.batch_run(batch_str, async=False)
 	doc = getPayload(ricci_xml)



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-10-16 20:56 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2006-10-16 20:56 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-10-16 20:56:09

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

Log message:
	fix for a corner case

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/16 14:56:47	1.29
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/16 20:56:09	1.30
@@ -444,6 +444,9 @@
 	return resultlist
 
 def getClusterConf(rc):
+	if rc is None:
+		return None
+
 	doc = xml.dom.minidom.Document()
 	batch = doc.createElement('batch')
 	module = doc.createElement('module')



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-10-16 14:56 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2006-10-16 14:56 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-10-16 14:56:48

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

Log message:
	we still need this workaround

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/16 04:26:19	1.28
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/16 14:56:47	1.29
@@ -456,6 +456,11 @@
 	module.appendChild(request)
 	batch.appendChild(module)
 
+	# temporary workaround for ricci bug
+	system_info = rc.system_name()
+	rc = RicciCommunicator(system_info)
+	# end workaround
+
 	try:
 		ret = rc.process_batch(batch)
 	except Exception, e:



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-10-12 22:41 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2006-10-12 22:41 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-10-12 22:41:27

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

Log message:
	nodeid must be > 0

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/12 21:57:09	1.25
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/12 22:41:27	1.26
@@ -778,11 +778,11 @@
     batch += '<function_call name="set_cluster.conf">'
     batch += '<var mutable="false" name="propagate" type="boolean" value="false"/>'
     batch += '<var mutable="false" name="cluster.conf" type="xml">'
-    batch += '<cluster config_version="1" name="' + cluster_name + '" alias="' + cluster_alias + '" cluster_version="' + cluster_version + '">'
+    batch += '<cluster config_version="1" name="' + cluster_name + '" alias="' + cluster_alias + '">'
     batch += '<fence_daemon post_fail_delay="0" post_join_delay="3"/>'
 
     batch += '<clusternodes>'
-    x = 0
+    x = 1
     for i in nodeList:
         if os_str == "rhel4":
           batch += '<clusternode name="' + i + '" votes="1" />'



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-10-12 21:57 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2006-10-12 21:57 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-10-12 21:57:09

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

Log message:
	set cluster_version xml attr

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/12 21:00:49	1.24
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/12 21:57:09	1.25
@@ -725,8 +725,14 @@
                        upgrade_rpms):
     batch = '<?xml version="1.0" ?>'
     batch += '<batch>'
-    
-    
+
+    if os_str == 'rhel5':
+        cluster_version = '5'
+    elif os_str == 'rhel4':
+        cluster_version = '4'
+    else:
+        cluster_version = 'unknown'
+
     batch += '<module name="rpm">'
     batch += '<request API_version="1.0">'
     batch += '<function_call name="install">'
@@ -772,7 +778,7 @@
     batch += '<function_call name="set_cluster.conf">'
     batch += '<var mutable="false" name="propagate" type="boolean" value="false"/>'
     batch += '<var mutable="false" name="cluster.conf" type="xml">'
-    batch += '<cluster config_version="1" name="' + cluster_name + '" alias="' + cluster_alias + '">'
+    batch += '<cluster config_version="1" name="' + cluster_name + '" alias="' + cluster_alias + '" cluster_version="' + cluster_version + '">'
     batch += '<fence_daemon post_fail_delay="0" post_join_delay="3"/>'
 
     batch += '<clusternodes>'



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-10-09 20:17 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2006-10-09 20:17 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-10-09 20:17:29

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

Log message:
	typo fix

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/04 16:05:43	1.21
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/09 20:17:29	1.22
@@ -729,7 +729,7 @@
         if os_str == "rhel4":
           batch += '<clusternode name="' + i + '" votes="1" />'
         else:
-          batch += '<clusternode name="' + i + '" votes="1" nodeid="' + x + '" />'
+          batch += '<clusternode name="' + i + '" votes="1" nodeid="' + str(x) + '" />'
         x = x + 1
 
     batch += '</clusternodes>'



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-08-14 16:01 jparsons
  0 siblings, 0 replies; 31+ messages in thread
From: jparsons @ 2006-08-14 16:01 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	jparsons at sourceware.org	2006-08-14 17:01:59

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

Log message:
	finalize logging code

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/08/13 16:15:28	1.16
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/08/14 16:01:59	1.17
@@ -581,9 +581,15 @@
     return (batch_number, result)
 
   def getNodeLogs(self):
-    QUERY_STR = '<?xml version="1.0" ?><ricci async="false" function="process_batch" version="1.0"><batch><module name=logging'
+    QUERY_STR = '<?xml version="1.0" ?><ricci async="false" function="process_batch" version="1.0"><batch><module name="log"><request sequence="1254" API_version="1.0"><function_call name="get"><var mutable="false" name="age" type="int" value="360000"/><var mutable="false" name="tags" type="list_str"><listentry value="cluster"/></var></function_call></request></module>'
 
-    pass
+    try:
+      payload = self.makeConnection(QUERY_STR)
+    except RicciReceiveError, r:
+      return "log not accessible"
+
+    #parse out log entry  
+    return payload
 
 def createClusterBatch(cluster_name, cluster_alias, nodeList, services, shared_storage, LVS):
     batch = '<?xml version="1.0" ?>'



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-08-12 17:59 jparsons
  0 siblings, 0 replies; 31+ messages in thread
From: jparsons @ 2006-08-12 17:59 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	jparsons at sourceware.org	2006-08-12 18:59:40

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

Log message:
	new helper functions

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/31 22:16:41	1.14
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/08/12 17:59:40	1.15
@@ -526,6 +526,59 @@
     batch_number, result = self.batchAttemptResult(payload)
     return (batch_number, result)
 
+  def nodeLeaveCluster(self, cluster_shutdown=False):
+    cshutdown = "false"
+    if cluster_shutdown == True:
+      cshutdown = "true"
+    QUERY_STR='<?xml version="1.0" ?><ricci async="true" function="process_batch" version="1.0"><batch><module name="cluster"><request sequence="111" API_version="1.0"><function_call name="stop_node"><var mutable="false" name="cluster_shutdown" type="boolean" value="' + cshutdown + '"/></function_call></request></module></batch></ricci>'
+
+    try:
+      payload = self.makeConnection(QUERY_STR)
+    except RicciReceiveError, r:
+      return None
+
+    batch_number, result = self.batchAttemptResult(payload)
+
+    return (batch_number, result)
+                                                                            
+  def nodeJoinCluster(self, cluster_startup=False):
+    cstartup = "false"
+    if cluster_startup == True:
+      cstartup = "true"
+    QUERY_STR='<?xml version="1.0" ?><ricci async="true" function="process_batch" version="1.0"><batch><module name="cluster"><request sequence="111" API_version="1.0"><function_call name="start_node"><var mutable="false" name="cluster_startup" type="boolean" value="' + cstartup + '"/></function_call></request></module></batch></ricci>'
+
+    try:
+      payload = self.makeConnection(QUERY_STR)
+    except RicciReceiveError, r:
+      return None
+
+    batch_number, result = self.batchAttemptResult(payload)
+
+    return (batch_number, result)
+
+  def nodeReboot(self):
+    QUERY_STR='<?xml version="1.0" ?><ricci async="true" function="process_batch" version="1.0"><batch><module name="reboot"><request sequence="111" API_version="1.0"><function_call name="reboot_now"/></request></module></batch></ricci>'
+
+    try:
+      payload = self.makeConnection(QUERY_STR)
+    except RicciReceiveError, r:
+      return None
+
+    batch_number, result = self.batchAttemptResult(payload)
+
+    return (batch_number, result)
+
+  def nodeFence(self, nodename):
+    QUERY_STR='<?xml version="1.0" ?><ricci async="true" function="process_batch" version="1.0"><batch><module name="cluster"><request sequence="111" API_version="1.0"><function_call name="fence_node"><var mutable="false" name="nodename" type="string" value="' + nodename + '"/></function_call></request></module></batch></ricci>'
+
+    try:
+      payload = self.makeConnection(QUERY_STR)
+    except RicciReceiveError, r:
+      return None
+
+    batch_number, result = self.batchAttemptResult(payload)
+
+    return (batch_number, result)
 
 def createClusterBatch(cluster_name, cluster_alias, nodeList, services, shared_storage, LVS):
     batch = '<?xml version="1.0" ?>'
@@ -592,3 +645,4 @@
     batch += '</batch>'
 
     return minidom.parseString(batch).firstChild
+



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-07-31 22:16 jparsons
  0 siblings, 0 replies; 31+ messages in thread
From: jparsons @ 2006-07-31 22:16 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	jparsons at sourceware.org	2006-07-31 22:16:41

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

Log message:
	Fixes for resource addition

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/31 21:18:35	1.13
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/31 22:16:41	1.14
@@ -1,5 +1,6 @@
 from time import *
 import os
+import sys
 from socket import *
 import xml
 import xml.dom
@@ -205,6 +206,7 @@
 
     # receive ricci header
     hello = self.__receive(ss)
+    print >> sys.stderr, hello.toxml()
     if hello != None:
         pass
         #print hello.toxml()
@@ -505,9 +507,9 @@
 
   def setClusterConf(self, clusterconf, propagate=True):
     if propagate == True:
-      propg = "True"
+      propg = "true"
     else:
-      propg = "False"
+      propg = "false"
 
     conf = str(clusterconf).replace('<?xml version="1.0"?>', '')
     conf = conf.replace('<?xml version="1.0" ?>', '')



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-07-31 21:18 kupcevic
  0 siblings, 0 replies; 31+ messages in thread
From: kupcevic @ 2006-07-31 21:18 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	kupcevic at sourceware.org	2006-07-31 21:18:36

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

Log message:
	setClusterConf fix

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/31 18:55:00	1.12
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/31 21:18:35	1.13
@@ -509,7 +509,11 @@
     else:
       propg = "False"
 
-    QUERY_STR='<?xml version="1.0" ?><ricci async="true" function="process_batch" version="1.0"><batch><module name="cluster"><request API_version="1.0"><function_call name="set_cluster.conf"/><var type="boolean" mutable="false" value="' + propg + '"/><var type="xml" mutable="false" name="cluster.conf"/>' + str(clusterconf) + </request></module></batch></ricci>'
+    conf = str(clusterconf).replace('<?xml version="1.0"?>', '')
+    conf = conf.replace('<?xml version="1.0" ?>', '')
+    conf = conf.replace('<? xml version="1.0"?>', '')
+    conf = conf.replace('<? xml version="1.0" ?>', '')
+    QUERY_STR='<?xml version="1.0" ?><ricci async="true" function="process_batch" version="1.0"><batch><module name="cluster"><request API_version="1.0"><function_call name="set_cluster.conf"><var type="boolean" name="propagate" mutable="false" value="' + propg + '"/><var type="xml" mutable="false" name="cluster.conf">' + conf + '</var></function_call></request></module></batch></ricci>'
 
     try:
       payload = self.makeConnection(QUERY_STR)



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-07-31 18:55 jparsons
  0 siblings, 0 replies; 31+ messages in thread
From: jparsons @ 2006-07-31 18:55 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	jparsons at sourceware.org	2006-07-31 18:55:00

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

Log message:
	Fixed setClusterConf call

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/28 19:46:57	1.11
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/31 18:55:00	1.12
@@ -509,7 +509,7 @@
     else:
       propg = "False"
 
-    QUERY_STR='<?xml version="1.0" ?><ricci async="true" function="process_batch" version="1.0"><batch><module name="cluster"><request API_version="1.0"><function_call name="set_cluster.conf"/><var propagate="' + propg + '"/><var cluster.conf="' + str(clusterconf) + '"/></request></module></batch></ricci>'
+    QUERY_STR='<?xml version="1.0" ?><ricci async="true" function="process_batch" version="1.0"><batch><module name="cluster"><request API_version="1.0"><function_call name="set_cluster.conf"/><var type="boolean" mutable="false" value="' + propg + '"/><var type="xml" mutable="false" name="cluster.conf"/>' + str(clusterconf) + </request></module></batch></ricci>'
 
     try:
       payload = self.makeConnection(QUERY_STR)



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-07-28 19:46 jparsons
  0 siblings, 0 replies; 31+ messages in thread
From: jparsons @ 2006-07-28 19:46 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	jparsons at sourceware.org	2006-07-28 19:46:58

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

Log message:
	Fix for setClusterConf

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/28 11:46:35	1.10
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/28 19:46:57	1.11
@@ -509,7 +509,7 @@
     else:
       propg = "False"
 
-    QUERY_STR='<?xml version="1.0" ?><ricci async="true" function="process_batch" version="1.0"><batch><module name="cluster"><request API_version="1.0"><function_call name="set_cluster.conf"/><var propagate="' + propg + '" cluster.conf="' + str(clusterconf) + '"/></request></module></batch></ricci>'
+    QUERY_STR='<?xml version="1.0" ?><ricci async="true" function="process_batch" version="1.0"><batch><module name="cluster"><request API_version="1.0"><function_call name="set_cluster.conf"/><var propagate="' + propg + '"/><var cluster.conf="' + str(clusterconf) + '"/></request></module></batch></ricci>'
 
     try:
       payload = self.makeConnection(QUERY_STR)



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-07-27 14:24 jparsons
  0 siblings, 0 replies; 31+ messages in thread
From: jparsons @ 2006-07-27 14:24 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	jparsons at sourceware.org	2006-07-27 14:23:59

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

Log message:
	set cluster.conf method

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/19 22:50:13	1.8
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/27 14:23:59	1.9
@@ -514,6 +514,24 @@
 
       return False
 
+def setClusterConf(clusterconf, propagate=True):
+  if propagate == True:
+    propg = "True"
+  else:
+    propg = "False"
+
+  QUERY_STR='<?xml version="1.0" ?><ricci async="true" function="process_batch" version="1.0"><batch><module name="cluster"><request API_version="1.0"><function_call name="set_cluster.conf"/><var propagate="' + propg + '" cluster.conf="' + clusterconf + '"/></request></module></batch></ricci>'
+
+  try:
+    payload = self.makeConnection(QUERY_STR)
+  except RicciReceiveError, r:
+    return None
+                                                                                
+                                                                                
+  batch_number, result = self.batchAttemptResult(payload)
+  return (batch_number, result)
+
+
 def createClusterBatch(cluster_name, cluster_alias, nodeList, services, shared_storage, LVS):
     batch = '<?xml version="1.0" ?>'
     batch += '<batch>'



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-07-19 22:50 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2006-07-19 22:50 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-07-19 22:50:13

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

Log message:
	fix error in batch command construction

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/19 22:28:17	1.7
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/19 22:50:13	1.8
@@ -556,7 +556,11 @@
         batch += '<clusternode name="' + i + '" votes="1" />'
     batch += '</clusternodes>'
 
-    batch += '<cman/>'
+    if len(nodeList) == 2:
+        batch += '<cman expected_votes="1" two_node="1"/>'
+    else:
+        batch += '<cman/>'
+ 
     batch += '<fencedevices/>'
     batch += '<rm/>'
     batch += '</cluster>'
@@ -567,7 +571,9 @@
     
     batch += '<module name="cluster">'
     batch += '<request API_version="1.0">'
-    batch += '<function_call name="start_node" cluster_startup="true"/>'
+    batch += '<function_call name="start_node">'
+    batch += '<var mutable="false" name="cluster_startup" type="boolean" value="true"/>'
+    batch += '</function_call>'
     batch += '</request>'
     batch += '</module>'
     batch += '</batch>'



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-07-19 21:02 rmccabe
  0 siblings, 0 replies; 31+ messages in thread
From: rmccabe @ 2006-07-19 21:02 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-07-19 21:02:32

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

Log message:
	support specifying a cluster alias for creation

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/19 20:57:39	1.4
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/19 21:02:32	1.5
@@ -514,7 +514,7 @@
 
       return False
 
-def createClusterBatch(cluster_name, nodeList, services, shared_storage, LVS):
+def createClusterBatch(cluster_name, cluster_alias, nodeList, services, shared_storage, LVS):
     batch = '<?xml version="1.0" ?>'
     batch += '<batch>'
     batch += '<module name="rpm">'
@@ -548,7 +548,7 @@
     batch += '<function_call name="set_cluster.conf">'
     batch += '<var mutable="false" name="propagate" type="boolean" value="false"/>'
     batch += '<var mutable="false" name="cluster.conf" type="xml">'
-    batch += '<cluster config_version="1" name="' + cluster_name + '">'
+    batch += '<cluster config_version="1" name="' + cluster_name + '" alias="' + cluster_alias + '">'
     batch += '<fence_daemon post_fail_delay="0" post_join_delay="3"/>'
 
     batch += '<clusternodes>'



^ permalink raw reply	[flat|nested] 31+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py
@ 2006-07-17 21:58 jparsons
  0 siblings, 0 replies; 31+ messages in thread
From: jparsons @ 2006-07-17 21:58 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	jparsons at sourceware.org	2006-07-17 21:58:49

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

Log message:
	Fixes inability to rollover when searching for a working ricci agent in a cluster

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/14 16:00:26	1.2
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/17 21:58:48	1.3
@@ -475,7 +475,10 @@
         
     def getRicciResponse(self):
       sock = socket(AF_INET, SOCK_STREAM)
-      sock.connect((self.__hostname, self.__port))
+      try:
+        sock.connect((self.__hostname, self.__port))
+      except:
+        return False
       ss = ssl(sock, PATH_TO_PRIVKEY, PATH_TO_CACERT)
       # receive ricci header
       hello = self.__receive(ss)



^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2007-03-21 17:18 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-23 19:31 [Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py jparsons
  -- strict thread matches above, loose matches on Subject: below --
2007-03-21 17:18 rmccabe
2007-03-21 17:16 rmccabe
2007-03-21 17:14 rmccabe
2007-03-01  0:40 rmccabe
2006-12-12 19:03 rmccabe
2006-12-10 19:19 rmccabe
2006-11-20 23:36 rmccabe
2006-11-20 23:30 rmccabe
2006-11-20 23:30 rmccabe
2006-11-16 20:22 rmccabe
2006-11-16 20:20 rmccabe
2006-10-31 13:51 rmccabe
2006-10-25 16:01 rmccabe
2006-10-25 16:00 rmccabe
2006-10-23 19:24 jparsons
2006-10-16 20:56 rmccabe
2006-10-16 14:56 rmccabe
2006-10-12 22:41 rmccabe
2006-10-12 21:57 rmccabe
2006-10-09 20:17 rmccabe
2006-08-14 16:01 jparsons
2006-08-12 17:59 jparsons
2006-07-31 22:16 jparsons
2006-07-31 21:18 kupcevic
2006-07-31 18:55 jparsons
2006-07-28 19:46 jparsons
2006-07-27 14:24 jparsons
2006-07-19 22:50 rmccabe
2006-07-19 21:02 rmccabe
2006-07-17 21:58 jparsons

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).