Skip to contentSkip to conversation

conga/luci/site/luci/Extensions ricci_bridge.py

Cluster-devel [email protected] 1 participant 1 message Jul 27, 2006

lore
Share & tools
lore
#0 lore raw

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

luci/site/luci/Extensions/ricci_bridge.py +18 -0
@@ -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>'