Skip to contentSkip to conversation

conga/luci/site/luci/Extensions cluster_adapte ...

Cluster-devel [email protected] 1 participant 1 message Sep 22, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2006-09-22 18:24:45

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

Log message:
small tweaks

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

luci/site/luci/Extensions/cluster_adapters.py +4 -4
@@ -972,7 +972,7 @@
       
   hmap['resource_list'] = resource_list
   hmap['root_uuid'] = root_uuid
-  hmap['uuid_list'] = map(lambda x: make_uuid('resource'), range(30))
+  hmap['uuid_list'] = map(lambda x: make_uuid('resource'), xrange(30))
   return hmap
 
 def recurse_resources(parent_uuid, child, resource_list, indent_ctr, parent=None):
@@ -997,13 +997,13 @@
   rc_map['uuid'] = make_uuid('resource')
   rc_map['parent_uuid'] = parent_uuid
 
-  new_indent_ctr = indent_ctr + 1
-
   resource_list.append(rc_map)
   kids = child.getChildren()
   child_depth = 0
+  new_indent_ctr = indent_ctr + 1
   for kid in kids:
-    child_depth = recurse_resources(rc_map['uuid'], kid, resource_list, new_indent_ctr, child)
+    cdepth = recurse_resources(rc_map['uuid'], kid, resource_list, new_indent_ctr, child)
+    child_depth = max(cdepth, child_depth)
 
   rc_map['max_depth'] = child_depth
   return child_depth + 1