Commit cd61ba08 authored by Gabriel Monnerat's avatar Gabriel Monnerat

check first if the transition exists because in Slave Instance context this...

check first if the transition exists because in Slave Instance context this transition doesn't exist
parent 8f13d32a
...@@ -177,16 +177,17 @@ if (request_software_instance is None):\n ...@@ -177,16 +177,17 @@ if (request_software_instance is None):\n
# Find Computer partition\n # Find Computer partition\n
# XXX Link subscript to open order\n # XXX Link subscript to open order\n
else:\n else:\n
isTransitionPossible = portal.portal_workflow.isTransitionPossible\n
# Update existing software instance\n # Update existing software instance\n
request_software_instance.edit(\n request_software_instance.edit(\n
text_content=instance_xml,\n text_content=instance_xml,\n
sla_xml=sla_xml,\n sla_xml=sla_xml,\n
activate_kw={\'tag\': tag},\n activate_kw={\'tag\': tag},\n
)\n )\n
if state == \'started\':\n if state == \'started\' and isTransitionPossible(request_software_instance, "start_requested"):\n
request_software_instance.startRequested()\n request_software_instance.startRequested()\n
request_software_instance.activate(after_tag=tag).requestStartComputerPartition()\n request_software_instance.activate(after_tag=tag).requestStartComputerPartition()\n
elif state == \'stopped\':\n elif state == \'stopped\' and isTransitionPossible(request_software_instance, "stop_requested"):\n
request_software_instance.stopRequested()\n request_software_instance.stopRequested()\n
request_software_instance.activate(after_tag=tag).requestStopComputerPartition()\n request_software_instance.activate(after_tag=tag).requestStopComputerPartition()\n
......
389 390
\ 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