Commit 9ef4b3bb authored by Łukasz Nowak's avatar Łukasz Nowak

Avoid failures in case of bad sla xml.

parent 37ea1e21
...@@ -75,13 +75,18 @@ def assignComputerPartition(software_instance):\n ...@@ -75,13 +75,18 @@ def assignComputerPartition(software_instance):\n
if not person.Person_isAllowedToAllocate():\n if not person.Person_isAllowedToAllocate():\n
raise Unauthorized(\'Allocation disallowed\')\n raise Unauthorized(\'Allocation disallowed\')\n
\n \n
computer_partition_relative_url = person.Person_restrictMethodAsShadowUser(\n try:\n
shadow_document=person,\n sla_dict = software_instance.getSlaXmlAsDict()\n
callable_object=person.Person_findPartition,\n except Exception:\n
argument_list=[software_instance.getUrlString(), software_instance.getSourceReference(),\n # Note: it is impossible to import module exceptions from python scripts\n
software_instance.getPortalType(), software_instance.getSlaXmlAsDict()])\n computer_partition_relative_url = None\n
else:\n
computer_partition_relative_url = person.Person_restrictMethodAsShadowUser(\n
shadow_document=person,\n
callable_object=person.Person_findPartition,\n
argument_list=[software_instance.getUrlString(), software_instance.getSourceReference(),\n
software_instance.getPortalType(), sla_dict])\n
return computer_partition_relative_url\n return computer_partition_relative_url\n
return (None, None)\n
\n \n
software_instance = context\n software_instance = context\n
if software_instance.getValidationState() != \'validated\' \\\n if software_instance.getValidationState() != \'validated\' \\\n
......
186 187
\ 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