Skip to contentSkip to conversation

conga ./conga.spec.in.in luci/cluster/resource ...

Cluster-devel [email protected] 1 participant 1 message Nov 6, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2007-11-06 23:05:07

Modified files:
. : conga.spec.in.in
luci/cluster : resource-form-macros
luci/site/luci/Extensions: LuciClusterInfo.py
cluster_adapters.py
luci/site/luci/Extensions/ClusterModel: ModelBuilder.py

Log message:

	fix 264161

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&r1=1.89&r2=1.90
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&r1=1.44&r2=1.45
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciClusterInfo.py.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.274&r2=1.275
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py.diff?cvsroot=cluster&r1=1.12&r2=1.13

conga.spec.in.in +1 -0
@@ -300,6 +300,7 @@
 - Fixed bz320411 (conga should use the node name in cluster.conf and not FQDN for fencing)
 - Fixed bz253727 (RFE: graphical view should be default in partiton tables view)
 - Fixed bz337041 (Add option to not fail-back service)
+- Fixed bz264161 (RFE: support setting the "__independent_subtree" attribute on cluster resources)
 
 * Mon Aug 27 2007 Ryan McCabe <[email protected]> 0.10.0-6
 - Fixed bz253783
luci/cluster/resource-form-macros +21 -8
@@ -14,19 +14,32 @@
 <body>
 
 <div metal:define-macro="res_form_footer" tal:omit-tag="">
-	<p class="hbSubmit">
-		<input type="button"
-			onClick="validate_form(this.form);"
-			value="Submit"
-			tal:condition="not: sinfo" />
+	<tal:block tal:condition="not:sinfo">
+		<p class="hbSubmit">
+			<input type="button" value="Submit"
+				onClick="validate_form(this.form)" />
+		</p>
+	</tal:block>
+
+	<tal:block tal:condition="sinfo">
+		<table tal:condition="exists:res">
+			<tr>
+				<td>This resource is an independent subtree</td>
+				<td tal:define="isubtree res/attrs/__independent_subtree|nothing">
+					<input class="vanilla" type="checkbox"
+						name="__independent_subtree"
+						tal:attributes="checked python:(isubtree in ['1', 'true', 'True', True, 1]) and 'checked' or None" />
+				</td>
+			</tr>
+		</table>
 
-		<tal:block tal:condition="sinfo">
+		<p class="hbSubmit">
 			<input type="button" value="Add a child"
 				onClick="add_child_resource(this.form)" />
 			<input type="button" value="Delete this resource"
 				onClick="delete_resource(this.form)" />
-		</tal:block>
-	</p>
+		</p>
+	</tal:block>
 
 	<tal:block tal:condition="not:exists:res"
 		tal:define="global expclass string: invisible expander" />
luci/site/luci/Extensions/LuciClusterInfo.py +5 -3
@@ -287,10 +287,12 @@
 
 	#Note: Final version needs all resource attrs
 	if child.isRefObject() is True:
+		child_obj = child.getObj()
+		rc_map['attrs'] = child.getAttributes().copy()
+		rc_map['attrs'].update(child_obj.getAttributes())
+		rc_map['type'] = child_obj.getResourceType()
 		rc_map['ref_object'] = True
-		rc_map['tag_name'] = child.getObj().TAG_NAME
-		rc_map['type'] = child.getObj().getResourceType()
-		rc_map['attrs'] = child.getObj().getAttributes()
+		rc_map['tag_name'] = child_obj.TAG_NAME
 	else:
 		rc_map['tag_name'] = child.TAG_NAME
 		rc_map['type'] = child.getResourceType()
luci/site/luci/Extensions/cluster_adapters.py +5 -0
@@ -809,6 +809,11 @@
 
 		if resObj is None:
 			return (False, { 'errors': [ 'An error occurred while adding %s' % res_type ]})
+
+		if dummy_form.has_key('__independent_subtree'):
+			resObj.addAttribute('__independent_subtree', '1')
+		else:
+			resObj.removeAttribute('__independent_subtree')
 		form_hash[form_id]['obj'] = resObj
 
 	if len(errors) > 0:
luci/site/luci/Extensions/ClusterModel/ModelBuilder.py +9 -0
@@ -413,6 +413,15 @@
     if result is False:
       return result
 
+    try:
+      entity_attr = entity.getAttributes()
+      if entity_attr is not None:
+        for i in entity_attr.iterkeys():
+          if not rf.attr_hash.has_key(i):
+            rf.addAttribute(i, entity_attr[i])
+    except:
+      pass
+
     if parent is None:  #Must be a service
       self.resourcemanager_ptr.addChild(rf)
       self.resourcemanager_ptr.removeChild(entity)