Commit 3bffc8d2 authored by Antoine Catton's avatar Antoine Catton

Modify bang in order to bang the tree from root instance.

parent 0eb82799
...@@ -53,15 +53,18 @@ ...@@ -53,15 +53,18 @@
<value> <string>software_instance = state_change[\'object\']\n <value> <string>software_instance = state_change[\'object\']\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
\n \n
root_software_instance = software_instance\n root_hosting_subscription = portal.portal_catalog.getResultValue(uid=context.SoftwareInstance_getRootHostingSubscriptionUid)\n
while (software_instance is not None):\n root_software_instance = root_hosting_subscription.HostingSubscription_requestRootSoftwareInstance()\n
root_software_instance = software_instance\n
software_instance = software_instance.getPredecessorRelatedValue()\n
\n \n
for software_instance in context.portal_catalog(\n # Use iterative algorithm instead of recursive approach in order to avoid\n
portal_type=\'Software Instance\',\n # complexity as much as possible.\n
root_uid=root_software_instance.getUid()):\n flat_tree = [root_software_instance]\n
software_instance = software_instance.getObject()\n while True:\n
try:\n
software_instance = flat_tree.pop(0)\n
except:\n
break\n
flat_tree.extend(software_instance.getPredecessorValueList())\n
try:\n try:\n
software_instance.Item_getInstancePackingListLine(service_relative_url=portal.portal_preferences.getPreferredInstanceCleanupResource())\n software_instance.Item_getInstancePackingListLine(service_relative_url=portal.portal_preferences.getPreferredInstanceCleanupResource())\n
except ValueError:\n except ValueError:\n
......
328 329
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment