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