Commit 7a87927a authored by Antoine Catton's avatar Antoine Catton

Avoid doing update when there's no sale packing list line.

parent 36fad94c
...@@ -73,7 +73,11 @@ service_uid_state_mapping = {\n ...@@ -73,7 +73,11 @@ service_uid_state_mapping = {\n
setup_resource_uid: [\'stopped\'],\n setup_resource_uid: [\'stopped\'],\n
hosting_resource_uid: [\'started\', \'delivered\']\n hosting_resource_uid: [\'started\', \'delivered\']\n
}\n }\n
previous_packing_list_line = context.SoftwareInstance_getInstancePackingListLine(state_change)\n try:\n
previous_packing_list_line = context.SoftwareInstance_getInstancePackingListLine(state_change)\n
except ValueError:\n
# no packing list yet, no need to update\n
return\n
\n \n
if previous_packing_list_line.getResourceUid() == hosting_resource_uid:\n if previous_packing_list_line.getResourceUid() == hosting_resource_uid:\n
if previous_packing_list_line.getSimulationState() not in service_uid_state_mapping[hosting_resource_uid]:\n if previous_packing_list_line.getSimulationState() not in service_uid_state_mapping[hosting_resource_uid]:\n
......
347 348
\ 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