[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
Changes by:	rmccabe sourceware org	2006-07-19 20:57:39

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

Log message:
	add in stan's code to generate the batch command for creating a cluster

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

--- conga/luci/site/luci/Extensions/cluster_adapters.py	2006/07/19 20:19:53	1.3
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2006/07/19 20:57:39	1.4
@@ -105,7 +105,15 @@
 		'rnodeHash': rnodeHash,
 		'isComplete': len(errors) < 1 and len(filter(dfn, nodeList)) == 0
 	}
-	return (len(errors) < 1, {'errors': errors, 'requestResults': cluster_properties })
+
+	if cluster_properties['isComplete'] != True:
+		return (False, {'errors': errors, 'requestResults':cluster_properties })
+
+	if cluster_properties['isComplete'] == True:
+		for i in nodeList:
+			i = i # yell at ricci
+
+	return (len(errors) < 1, {'errors': errors, 'messages': messages })
 
 def createCluChooser(self, request, systems):
   dummynode = {}
--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/17 21:58:48	1.3
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/07/19 20:57:39	1.4
@@ -513,3 +513,61 @@
                   return False
 
       return False
+
+def createClusterBatch(cluster_name, nodeList, services, shared_storage, LVS):
+    batch = '<?xml version="1.0" ?>'
+    batch += '<batch>'
+    batch += '<module name="rpm">'
+    batch += '<request API_version="1.0">'
+    batch += '<function_call name="install">'
+    batch += '<var name="sets" type="list_xml">'
+    batch += '<set name="Cluster Base"/>'
+
+    if services:
+        batch += '<set name="Cluster Service Manager"/>'
+
+    if shared_storage:
+        batch += '<set name="Clustered Storage"/>'
+
+    if LVS:
+        batch += '<set name="Linux Virtual Server"/>'
+
+    batch += '</var>'
+    batch += '</function_call>'
+    batch += '</request>'
+    batch += '</module>'
+    
+    batch += '<module name="reboot">'
+    batch += '<request API_version="1.0">'
+    batch += '<function_call name="reboot_now"/>'
+    batch += '</request>'
+    batch += '</module>'
+    
+    batch += '<module name="cluster">'
+    batch += '<request API_version="1.0">'
+    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 += '<fence_daemon post_fail_delay="0" post_join_delay="3"/>'
+
+    batch += '<clusternodes>'
+    for i in nodeList:
+        batch += '<clusternode name="' + i + '" votes="1" />'
+    batch += '</clusternodes>'
+
+    batch += '<cman/>'
+    batch += '<fencedevices/>'
+    batch += '<rm/>'
+    batch += '</cluster>'
+    batch += '</var>'
+    batch += '</function_call>'
+    batch += '</request>'
+    batch += '</module>'
+    
+    batch += '<module name="cluster">'
+    batch += '<request API_version="1.0">'
+    batch += '<function_call name="start_node" cluster_startup="true"/>'
+    batch += '</request>'
+    batch += '</module>'
+    batch += '</batch>'


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