Commit d260bfd8 authored by Romain Courteaud's avatar Romain Courteaud

Parameters are now required.

Do not set any default value anymore.
This should ease compatibility issue (less maintainance).
parent ad22fdcc
...@@ -56,13 +56,24 @@ person = state_change[\'object\']\n ...@@ -56,13 +56,24 @@ person = state_change[\'object\']\n
portal = person.getPortalObject()\n portal = person.getPortalObject()\n
# Get required arguments\n # Get required arguments\n
kwargs = state_change.kwargs\n kwargs = state_change.kwargs\n
software_release_url_string = state_change.kwargs[\'software_release\']\n \n
software_title = kwargs["software_title"]\n # Required args\n
software_type = kwargs.get("software_type") or "RootSoftwareInstance"\n # Raise TypeError if all parameters are not provided\n
instance_xml = kwargs["instance_xml"]\n try:\n
sla_xml = kwargs.get("sla_xml") or ""\n software_release_url_string = state_change.kwargs[\'software_release\']\n
is_slave = kwargs.get("shared", False)\n software_title = kwargs["software_title"]\n
state = kwargs.get(\'state\') or \'started\'\n software_type = kwargs["software_type"]\n
instance_xml = kwargs["instance_xml"]\n
sla_xml = kwargs["sla_xml"]\n
is_slave = kwargs["shared"]\n
state = kwargs["state"]\n
except KeyError:\n
raise TypeError, "Person_requestSoftwareInstance takes exactly 7 arguments"\n
\n
if state not in ["started", "stopped", "deleted"]:\n
raise ValueError, "state should be started, stopped or deleted"\n
elif is_slave not in [True, False]:\n
raise ValueError, "shared should be a boolean"\n
\n \n
hosting_subscription_portal_type = "Hosting Subscription"\n hosting_subscription_portal_type = "Hosting Subscription"\n
\n \n
......
696 697
\ 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