[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-11-08 21:42:50

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

Log message:
	- fix a couple of typos in the fence device code
	- redirect to the busy page when modifying cluster params and deploying a new cluster

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

--- conga/luci/site/luci/Extensions/cluster_adapters.py	2006/11/08 15:52:41	1.154
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2006/11/08 21:42:50	1.155
@@ -233,8 +233,8 @@
 				return (False, {'errors': errors, 'requestResults':cluster_properties })
 		buildClusterCreateFlags(self, batch_id_map, clusterName)
 
-	messages.append('Creation of cluster \"' + clusterName + '\" has begun')
-	return (True, {'errors': errors, 'messages': messages })
+	response = request.RESPONSE
+	response.redirect(request['URL'] + "?pagetype=" + CLUSTER_CONFIG + "&clustername=" + clusterName)
 
 def buildClusterCreateFlags(self, batch_map, clusterName):
   path = str(CLUSTER_FOLDER_PATH + clusterName)
@@ -849,8 +849,11 @@
 
 	if len(errors) < 1:
 		messages.append('The cluster properties have been updated.')
+	else:
+		return (retcode, {'errors': errors, 'messages': messages})
 
-	return (retcode, {'errors': errors, 'messages': messages})
+	response = request.RESPONSE
+	response.redirect(request['URL'] + "?pagetype=" + CLUSTER_CONFIG + "&clustername=" + clustername)
 
 def validateFenceAdd(self, request):
 	return (True, {})
@@ -1260,19 +1263,6 @@
   kids.append(rvcfg)
   rv['children'] = kids
  ################################################################
-
-  cprop = {}
-  cprop['Title'] = 'Configure'
-  cprop['cfg_type'] = 'configuration paramters'
-  cprop['absolute_url'] = url + '?pagetype=' + CLUSTER_CONFIG + '&clustername=' + cluname
-  cprop['Description'] = 'Change cluster configuration parameters'
-  cprop['show_children'] = False
-  if pagetype == CLUSTER_CONFIG:
-    cprop['currentItem'] = True
-  else:
-    cprop['currentItem'] = False
-
- #################################################################
   fd = {}
   fd['Title'] = "Failover Domains"
   fd['cfg_type'] = "failoverdomains"
@@ -1416,7 +1406,6 @@
   mylist.append(nd)
   mylist.append(sv)
   mylist.append(rv)
-  mylist.append(cprop)
   mylist.append(fd)
   mylist.append(fen)
 
@@ -2892,6 +2881,8 @@
                   found_duplicate = True
               if found_duplicate == True:
                 continue
+              baseurl = request['URL']
+              clustername = model.getClusterName()
               node_hash = {}
               node_hash['nodename'] = node.getName().strip()
               node_hash['nodeurl'] = baseurl + "?clustername=" + clustername + "&nodename=" + node.getName() + "&pagetype=" + NODE 
@@ -2963,7 +2954,7 @@
       if fd != None:
         if fd.isShared() == False:  #Not a shared dev...build struct and add
           fencedev = {}
-          fencedev['prettyname'] = FenceHandler.FENCE_OPTS[fd.getAgentType()]
+          fencedev['prettyname'] = FENCE_OPTS[fd.getAgentType()]
           fencedev['isShared'] = False
           fencedev['id'] = str(major_num)
           major_num = major_num + 1
@@ -3000,7 +2991,7 @@
             continue
           else: #Shared, but not used above...so we need a new fencedev struct
             fencedev = {}
-            fencedev['prettyname'] = FenceHandler.FENCE_OPTS[fd.getAgentType()]
+            fencedev['prettyname'] = FENCE_OPTS[fd.getAgentType()]
             fencedev['isShared'] = True
             fencedev['cfgurl'] = baseurl + "?clustername=" + clustername + "&fencename=" + fd.getName().strip() + "&pagetype=" + FENCEDEV 
             fencedev['id'] = str(major_num)
@@ -3029,7 +3020,7 @@
       isUnique = True
       if fd.isShared() == False:
         continue
-      for fdev in level1
+      for fdev in level1:
         if fd.getName.strip() == fdev['name']:
           isUnique = False
           break
@@ -3038,7 +3029,7 @@
         shared_struct['name'] = fd.getName().strip()
         agentname = fd.getAgentType()
         shared_struct['agent'] = agentname
-        shared_struct['prettyname'] = FenceHandler.FENCE_OPTS[agentname]
+        shared_struct['prettyname'] = FENCE_OPTS[agentname]
         shared1.append(shared_struct)
 
   #YUK: This next section violates the DRY rule, :-(
@@ -3057,7 +3048,7 @@
       if fd != None:
         if fd.isShared() == False:  #Not a shared dev...build struct and add
           fencedev = {}
-          fencedev['prettyname'] = FenceHandler.FENCE_OPTS[fd.getAgentType()]
+          fencedev['prettyname'] = FENCE_OPTS[fd.getAgentType()]
           fencedev['isShared'] = False
           fencedev['id'] = str(major_num)
           major_num = major_num + 1
@@ -3094,7 +3085,7 @@
             continue
           else: #Shared, but not used above...so we need a new fencedev struct
             fencedev = {}
-            fencedev['prettyname'] = FenceHandler.FENCE_OPTS[fd.getAgentType()]
+            fencedev['prettyname'] = FENCE_OPTS[fd.getAgentType()]
             fencedev['isShared'] = True
             fencedev['cfgurl'] = baseurl + "?clustername=" + clustername + "&fencename=" + fd.getName().strip() + "&pagetype=" + FENCEDEV 
             fencedev['id'] = str(major_num)
@@ -3123,7 +3114,7 @@
       isUnique = True
       if fd.isShared() == False:
         continue
-      for fdev in level2
+      for fdev in level2:
         if fd.getName.strip() == fdev['name']:
           isUnique = False
           break
@@ -3132,7 +3123,7 @@
         shared_struct['name'] = fd.getName().strip()
         agentname = fd.getAgentType()
         shared_struct['agent'] = agentname
-        shared_struct['prettyname'] = FenceHandler.FENCE_OPTS[agentname]
+        shared_struct['prettyname'] = FENCE_OPTS[agentname]
         shared2.append(shared_struct)
 
   return map    


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