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

[Cluster-devel] conga/luci cluster/form-macros site/luci/Exten ...



CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	shuennek sourceware org	2006-08-03 18:36:21

Modified files:
	luci/cluster   : form-macros 
	luci/site/luci/Extensions: cluster_adapters.py 

Log message:
	Fixed problems with adding IP resource, made it check for flags on FS, NFSMounts better. -Stephen Huenneke

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

--- conga/luci/cluster/form-macros	2006/08/02 17:27:18	1.16
+++ conga/luci/cluster/form-macros	2006/08/03 18:36:21	1.17
@@ -1,13 +1,13 @@
-<html>
-
-<head>
-	<title tal:content="template/title">The title</title>
-</head>
-
+<html>	
+		
+<head>	
+		<title tal:content="template/title">The title</title>
+</head>	
+	
 <body>
 
 <div metal:define-macro="entry-form">
-	<h2>Entry Form</h2>
+		<h2>Entry Form</h2>
 </div>
 
 <div metal:define-macro="busywaitpage">
--- conga/luci/site/luci/Extensions/cluster_adapters.py	2006/08/03 13:37:39	1.33
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2006/08/03 18:36:21	1.34
@@ -1437,9 +1437,10 @@
   for res in modelb.getResources():
     if res.getName() == name:
           resMap['name'] = res.getName()
-          resMap['type'] = res.resource_type
-          resMap['tag_name'] = res.TAG_NAME
-          resMap['cfgurl'] = baseurl + "?" + "clustername=" + cluname + "&resourcename=" + res.getName() + "&pagetype=" + RESOURCE_CONFIG
+	  resMap['type'] = res.resource_type
+	  resMap['tag_name'] = res.TAG_NAME
+	  resMap['attrs'] = res.attr_hash
+	  resMap['cfgurl'] = baseurl + "?" + "clustername=" + cluname + "&resourcename=" + res.getName() + "&pagetype=" + RESOURCE_CONFIG
           return resMap
 
   return {}
@@ -1487,7 +1488,7 @@
   if not request.form:
     return "Nothing submitted, no changes made."
                                                                                 
-  if not request.form["resourceName"]:
+  if request.form['type'] != 'ip' and  not request.form['resourceName']:
     return "Please enter a name for the resource."
   types = {'ip': addIp,
            'fs': addFs,
@@ -1523,8 +1524,10 @@
   flag = self.restrictedTraverse(objpath)
   flag.manage_addProperty(BATCH_ID,batch_id, "string")
   flag.manage_addProperty(TASKTYPE,RESOURCE_ADD, "string")
-  flag.manage_addProperty(FLAG_DESC,"Creating Resource \'" + request.form['resourceName'] + "\'", "string")
-
+  if type != 'ip':
+	  flag.manage_addProperty(FLAG_DESC,"Creating New Resource \'" + request.form['resourceName'] + "\'", "string")
+  else:
+	  flag.manage_addProperty(FLAG_DESC,"Creating New Resource \'" + res.attr_hash['address'] + "\'", "string")
   response = request.RESPONSE
   response.redirect(request['HTTP_REFERER'] + "&busyfirst=true")
 


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