Commit 89e09478 authored by Romain Courteaud's avatar Romain Courteaud

Be consistent with hosting subscription creation.

Directly provide the instance document in the request.
parent 75f81343
...@@ -170,7 +170,7 @@ promise_kw = {\n ...@@ -170,7 +170,7 @@ promise_kw = {\n
\'shared\': is_slave,\n \'shared\': is_slave,\n
}\n }\n
request_software_instance_url = request_software_instance.getRelativeUrl()\n request_software_instance_url = request_software_instance.getRelativeUrl()\n
context.REQUEST.set(\'request_instance\', request_software_instance_url)\n context.REQUEST.set(\'request_instance\', request_software_instance)\n
if (root_state == "started"):\n if (root_state == "started"):\n
request_software_instance.requestStart(**promise_kw)\n request_software_instance.requestStart(**promise_kw)\n
elif (root_state == "stopped"):\n elif (root_state == "stopped"):\n
......
34 35
\ No newline at end of file \ No newline at end of file
...@@ -834,11 +834,10 @@ class SlapTool(BaseTool): ...@@ -834,11 +834,10 @@ class SlapTool(BaseTool):
sla_xml=sla_xml, sla_xml=sla_xml,
state=state) state=state)
requested_software_instance_url = self.REQUEST.get('request_instance') requested_software_instance = self.REQUEST.get('request_instance')
if requested_software_instance_url is None: if requested_software_instance is None:
raise SoftwareInstanceNotReady raise SoftwareInstanceNotReady
else: else:
requested_software_instance = portal.restrictedTraverse(requested_software_instance_url)
if not requested_software_instance.getAggregate(portal_type="Computer Partition"): if not requested_software_instance.getAggregate(portal_type="Computer Partition"):
raise SoftwareInstanceNotReady raise SoftwareInstanceNotReady
else: else:
......
...@@ -604,10 +604,8 @@ class TestVifibSlapWebServiceMixin(testVifibMixin): ...@@ -604,10 +604,8 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
software_instance_portal_type = kw.get("instance_portal_type", software_instance_portal_type = kw.get("instance_portal_type",
self.software_instance_portal_type) self.software_instance_portal_type)
software_instance = self.portal.unrestrictedTraverse( software_instance = self.portal.REQUEST.get('request_instance')
self.portal.REQUEST.get('request_instance')) hosting_subscription = self.portal.REQUEST.get('request_hosting_subscription')
hosting_subscription = self.portal.unrestrictedTraverse(
self.portal.REQUEST.get('request_hosting_subscription'))
sequence.edit( sequence.edit(
root_software_instance_title=software_title, root_software_instance_title=software_title,
software_instance_uid=software_instance.getUid(), software_instance_uid=software_instance.getUid(),
......
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