[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	2007-01-31 18:50:29

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

Log message:
	- redirect to the cluster list page after deleting a cluster
	- catch a couple of exceptions that could be hit when deleting a non-GULM cluster

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

--- conga/luci/site/luci/Extensions/cluster_adapters.py	2007/01/31 05:26:45	1.219
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2007/01/31 18:50:29	1.220
@@ -3323,6 +3323,7 @@
 	if not model:
 		return 'Unable to get the model object for %s' % cluname
 
+	redirect_page = NODES
 	if task == CLUSTER_STOP:
 		clusterStop(self, model)
 	elif task == CLUSTER_START:
@@ -3330,13 +3331,15 @@
 	elif task == CLUSTER_RESTART:
 		clusterRestart(self, model)
 	elif task == CLUSTER_DELETE:
-		clusterStop(self, model, delete=True)
+		ret = clusterDelete(self, model)
+		if ret is not None:
+			redirect_page = ret
 	else:
 		return 'An unknown cluster task was requested.'
 
 	response = request.RESPONSE
 	response.redirect('%s?pagetype=%s&clustername=%s&busyfirst=true' \
-		% (request['URL'], NODES, model.getClusterName()))
+		% (request['URL'], redirect_page, model.getClusterName()))
 
 def getClusterInfo(self, model, req):
   try:
@@ -3706,6 +3709,7 @@
 		except Exception, e:
 			luci_log.debug_verbose('clusterDelete2: %s %s' \
 				% (clustername, str(e)))
+		return CLUSTERLIST
 	else:
 		luci_log.debug_verbose('clusterDelete2: %s: %d errors' \
 			% (clustername, num_errors))
@@ -4116,7 +4120,10 @@
 
   fdom_dict_list = list()
   if model:
-    infohash['gulm_lockserver'] = model.isNodeLockserver(nodename)
+    try:
+      infohash['gulm_lockserver'] = model.isNodeLockserver(nodename)
+    except:
+      infohash['gulm_lockserver'] = False
     #next is faildoms
     fdoms = model.getFailoverDomainsForNode(nodename)
     for fdom in fdoms:
@@ -4197,7 +4204,10 @@
     map = {}
     name = item['name']
     map['nodename'] = name
-    map['gulm_lockserver'] = model.isNodeLockserver(name)
+    try:
+      map['gulm_lockserver'] = model.isNodeLockserver(name)
+    except:
+      map['gulm_lockserver'] = False
 
     try:
       baseurl = req['URL']


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