Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
107
Merge Requests
107
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
ff4ef999
Commit
ff4ef999
authored
May 11, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Useless comments
parent
4ba15a0f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
237 deletions
+1
-237
master/bt5/vifib_slapos_core/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/scripts/RequesterInstance_request.xml
..._interface_workflow/scripts/RequesterInstance_request.xml
+0
-236
master/bt5/vifib_slapos_core/bt/revision
master/bt5/vifib_slapos_core/bt/revision
+1
-1
No files found.
master/bt5/vifib_slapos_core/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/scripts/RequesterInstance_request.xml
View file @
ff4ef999
...
...
@@ -178,242 +178,6 @@ requester_instance.edit(predecessor_list=predecessor_list)\n
# check if all elements are still connected and if there is no cycle\n
request_software_instance.checkConnected(graph, hosting_subscription.getUid())\n
request_software_instance.checkNotCyclic(graph)\n
\n
\n
# Update the requested state\n
\n
# packing_list_line = software_instance.getAggregateRelatedValue(portal_type="Sale Packing List Line")\n
# subscription = packing_list_line.getAggregateValue(portal_type="Hosting Subscription")\n
# software_release_document = context.portal_catalog.getResultValue(\n
# portal_type=\'Software Release\',\n
# url_string=software_release_url_string)\n
# base_sale_packing_list = packing_list_line.getParentValue()\n
# trade_condition = packing_list_line.getSpecialise(portal_type="Sale Trade Condition")\n
# sale_order = portal.getDefaultModule(portal_type="Sale Order").newContent(\n
# portal_type="Sale Order",\n
# destination=base_sale_packing_list.getDestination(),\n
# destination_section=base_sale_packing_list.getDestinationSection(),\n
# destination_decision=base_sale_packing_list.getDestinationDecision(),\n
# start_date=DateTime(),\n
# received_date=DateTime(),\n
# # XXX Hardcoded values\n
# source="organisation_module/vifib_internet",\n
# source_section="organisation_module/vifib_internet",\n
# quantity_unit="unit/piece",\n
# price_currency="currency_module/EUR",\n
# activate_kw={\'tag\': tag},\n
# )\n
# \n
# setup_service_relative_url = portal.portal_preferences.getPreferredInstanceSetupResource()\n
# service = portal.restrictedTraverse(setup_service_relative_url)\n
# sale_order.setSpecialise(trade_condition, portal_type="Sale Trade Condition")\n
# sale_order_line = sale_order.newContent(\n
# portal_type="Sale Order Line",\n
# resource=setup_service_relative_url,\n
# quantity=1,\n
# price=service.getSaleSupplyLineBasePrice(),\n
# aggregate_value_list=[request_software_instance,subscription,software_release_document],\n
# activate_kw={\'tag\': tag},\n
# )\n
# sale_order.order()\n
\n
# if state == \'started\':\n
# request_software_instance.startRequested()\n
# request_software_instance.activate(after_tag=tag).requestStartComputerPartition()\n
# elif state == \'stopped\':\n
# request_software_instance.stopRequested()\n
# request_software_instance.activate(after_tag=tag).requestStopComputerPartition()\n
# else:\n
# raise ValueError(\'State %r is not supported\' % state)\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
# # copy and paste from\n
# # portal_workflow/person_slap_interface_workflow/scripts/Person_requestSoftwareInstance\n
# if (portal.portal_activities.countMessageWithTag(tag) > 0):\n
# # The software instance is already under creation but can not be fetched from catalog\n
# # As it is not possible to fetch informations, it is better to raise an error\n
# raise NotImplementedError(tag)\n
# hosting_subscription = context\n
# \n
# sale_order_portal_type = "Sale Order"\n
# sale_order_line_portal_type = "Sale Order Line"\n
# hosting_subscription_portal_type = "Hosting Subscription"\n
# if hosting_subscription.isRootSlave():\n
# software_instance_portal_type = "Slave Instance"\n
# else:\n
# software_instance_portal_type = "Software Instance"\n
# \n
# # Mostly copy and paste from\n
# # portal_workflow/person_slap_interface_workflow/scripts/Person_requestSoftwareInstance\n
# request_software_instance = hosting_subscription.portal_catalog.getResultValue(\n
# portal_type=software_instance_portal_type,\n
# title=hosting_subscription.getTitle(),\n
# root_uid=hosting_subscription.getUid(),\n
# )\n
# \n
# new_one = False\n
# if (request_software_instance is None):\n
# new_one = True\n
# setup_service_relative_url = portal.portal_preferences.getPreferredInstanceSetupResource()\n
# service = portal.restrictedTraverse(setup_service_relative_url)\n
# request_software_instance = portal.getDefaultModule(portal_type=software_instance_portal_type).newContent(\n
# portal_type=software_instance_portal_type,\n
# source_reference=hosting_subscription.getSourceReference(),\n
# title=hosting_subscription.getTitle(),\n
# text_content=hosting_subscription.getTextContent(),\n
# sla_xml=hosting_subscription.getSlaXml(),\n
# activate_kw={\'tag\': tag},\n
# **portal.Base_getNewSoftwareInstanceCoordinate()\n
# )\n
# request_software_instance.portal_workflow.doActionFor(request_software_instance,\n
# \'validate_action\')\n
# \n
# software_release_document = context.portal_catalog.getResultValue(\n
# portal_type=\'Software Release\',\n
# url_string=hosting_subscription.getRootSoftwareReleaseUrl())\n
# \n
# sale_order = portal.getDefaultModule(portal_type=sale_order_portal_type).newContent(\n
# portal_type=sale_order_portal_type,\n
# destination=person_relative_url,\n
# destination_section=person_relative_url,\n
# destination_decision=person_relative_url,\n
# start_date=DateTime(),\n
# received_date=DateTime(),\n
# # XXX Hardcoded values\n
# specialise=\'sale_trade_condition_module/vifib_trade_condition\',\n
# source="organisation_module/vifib_internet",\n
# source_section="organisation_module/vifib_internet",\n
# quantity_unit="unit/piece",\n
# price_currency="currency_module/EUR",\n
# activate_kw={\'tag\': tag},\n
# )\n
# sale_order_line = sale_order.newContent(\n
# portal_type=sale_order_line_portal_type,\n
# resource=setup_service_relative_url,\n
# quantity=1,\n
# price=service.getSaleSupplyLineBasePrice(),\n
# aggregate_value_list=[request_software_instance,\n
# hosting_subscription,\n
# software_release_document\n
# ],\n
# activate_kw={\'tag\': tag},\n
# )\n
# #portal.portal_workflow.doActionFor(sale_order, "order_action")\n
# # XXX: Do not verify security\n
# sale_order.order()\n
# \n
# hosting_subscription_predecessor_list = hosting_subscription.getPredecessorList()\n
# hosting_subscription_predecessor_list.append(request_software_instance.getRelativeUrl())\n
# hosting_subscription.edit(predecessor_list=hosting_subscription_predecessor_list)\n
# \n
# # Find Computer partition\n
# # XXX Link subscript to open order\n
# else:\n
# # Update existing software instance\n
# request_software_instance.edit(\n
# text_content=hosting_subscription.getTextContent(),\n
# source_reference=hosting_subscription.getSourceReference(),\n
# sla_xml=hosting_subscription.getSlaXml(),\n
# activate_kw={\'tag\': tag},\n
# )\n
# for predecessor_related in request_software_instance.getPredecessorRelatedValueList():\n
# predecessor_list = predecessor_related.getPredecessorList()\n
# predecessor_list.remove(request_software_instance.getRelativeUrl())\n
# predecessor_related.setPredecessorList(predecessor_list)\n
# \n
# hosting_subscription_predecessor_list = hosting_subscription.getPredecessorList()\n
# hosting_subscription_predecessor_list.append(request_software_instance.getRelativeUrl())\n
# hosting_subscription.setPredecessorList(hosting_subscription_predecessor_list)\n
# \n
# if hosting_subscription.getSlapState() == \'start_requested\':\n
# request_software_instance.startRequested()\n
# if not new_one:\n
# request_software_instance.activate(after_tag=tag).requestStartComputerPartition()\n
# elif hosting_subscription.getSlapState() == \'stop_requested\':\n
# request_software_instance.stopRequested()\n
# if not new_one:\n
# request_software_instance.activate(after_tag=tag).requestStopComputerPartition()\n
# \n
# return request_software_instance\n
# \n
# \n
# \n
# \n
# \n
# \n
# \n
# \n
# \n
# \n
# \n
# \n
# \n
# \n
# \n
# \n
# \n
# \n
# \n
# instance = state_change[\'object\']\n
# portal = instance.getPortalObject()\n
# # Get required arguments\n
# kwargs = state_change.kwargs\n
# \n
# # Required args\n
# # Raise TypeError if all parameters are not provided\n
# try:\n
# software_release_url_string = state_change.kwargs[\'software_release\']\n
# software_type = kwargs["software_type"]\n
# instance_xml = kwargs["instance_xml"]\n
# sla_xml = kwargs["sla_xml"]\n
# is_slave = kwargs["shared"]\n
# # root_state = kwargs["state"]\n
# except KeyError:\n
# raise TypeError, "RequestedInstance_updateParameterInformation takes exactly 5 arguments"\n
# \n
# edit_kw = {\n
# \'root_software_release_url\': software_release_url_string,\n
# \'text_content\': instance_xml,\n
# \'source_reference\': software_type,\n
# \'sla_xml\': sla_xml,\n
# }\n
# \n
# # Check the slave management\n
# if is_slave not in [True, False]:\n
# raise ValueError, "shared should be a boolean"\n
# instance_portal_type = instance.getPortalType()\n
# if instance_portal_type == "Hosting Subscription":\n
# edit_kw[\'root_slave\'] = is_slave\n
# elif instance_portal_type == "Software Instance":\n
# if is_slave:\n
# raise NotImplementedError, "Please destroy before doing a slave (%s)" % \\\n
# (instance.getRelativeUrl(), )\n
# elif instance_portal_type == "Slave Instance":\n
# if not is_slave:\n
# raise NotImplementedError, "Please destroy before doing an instance (%s)" % \\\n
# (instance.getRelativeUrl(), )\n
# else:\n
# raise NotImplementedError, "Not supported portal type %s (%s)" % \\\n
# (instance.getPortalType(), instance.getRelativeUrl())\n
# \n
# instance.edit(**edit_kw)\n
]]>
</string>
</value>
...
...
master/bt5/vifib_slapos_core/bt/revision
View file @
ff4ef999
15
\ No newline at end of file
16
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment