Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Łukasz Nowak
slapos.core
Commits
1a2b4552
Commit
1a2b4552
authored
May 25, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop SoftwareInstance_getInstancePackingListLine.
parent
e0ba5534
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
162 deletions
+36
-162
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SoftwareInstance_getDefaultImageAbsoluteUrl.xml
...ifib_slap/SoftwareInstance_getDefaultImageAbsoluteUrl.xml
+7
-7
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SoftwareInstance_getInstancePackingListLine.xml
...ifib_slap/SoftwareInstance_getInstancePackingListLine.xml
+0
-107
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SoftwareInstance_getStatus.xml
...em/portal_skins/vifib_slap/SoftwareInstance_getStatus.xml
+28
-47
master/bt5/vifib_slap/bt/revision
master/bt5/vifib_slap/bt/revision
+1
-1
No files found.
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SoftwareInstance_getDefaultImageAbsoluteUrl.xml
View file @
1a2b4552
...
@@ -53,11 +53,11 @@
...
@@ -53,11 +53,11 @@
<value>
<string>
if context.getPortalType() == \'Sale Order Line\':\n
<value>
<string>
if context.getPortalType() == \'Sale Order Line\':\n
delivery_line = context\n
delivery_line = context\n
else:\n
else:\n
delivery_line = context.SoftwareInstance_getInstancePackingListLine(portal_type=["Sale Order Line", "Sale Packing List Line"])\n
delivery = context.getCausalityValue(portal_type=["Sale Order", "Sale Packing List"])\n
delivery_line = context.contentValues(portal_type=["Sale Order Line", "Sale Packing List Line"])[0]\n
\n
\n
if delivery_line is not None:\n
software_release = delivery_line.getAggregateValue(portal_type=\'Software Release\')\n
software_release = delivery_line.getAggregateValue(portal_type=\'Software Release\')\n
if software_release is not None:\n
if software_release is not None:\n
software_product = software_release.getAggregateValue()\n
software_product = software_release.getAggregateValue()\n
if software_product is not None:\n
if software_product is not None:\n
return "%s/index_html" % software_product.getDefaultImageAbsoluteUrl()\n
return "%s/index_html" % software_product.getDefaultImageAbsoluteUrl()\n
...
...
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SoftwareInstance_getInstancePackingListLine.xml
deleted
100644 → 0
View file @
e0ba5534
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
"""Dirty copy&paste of portal_workflow.software_instance_slap_interface_workflow.scripts.SoftwareInstance_getInstancePackingListLine"""\n
software_instance = context\n
\n
portal = software_instance.getPortalObject()\n
\n
# Get services\n
portal_preferences = portal.portal_preferences\n
service_uid_list = []\n
\n
if service_relative_url is None:\n
for service_relative_url in \\\n
(portal_preferences.getPreferredInstanceSetupResource(),\n
portal_preferences.getPreferredInstanceHostingResource(),\n
portal_preferences.getPreferredInstanceCleanupResource(),\n
):\n
service = portal.restrictedTraverse(service_relative_url)\n
service_uid_list.append(service.getUid())\n
else:\n
service = portal.restrictedTraverse(service_relative_url)\n
service_uid_list.append(service.getUid())\n
\n
# Packing List valid state\n
state_list = ["ordered"]\n
state_list.extend(portal.getPortalReservedInventoryStateList())\n
state_list.extend(portal.getPortalTransitInventoryStateList())\n
state_list.extend(portal.getPortalCurrentInventoryStateList())\n
\n
packing_list_line = portal.portal_catalog.getResultValue(\n
portal_type=portal_type,\n
simulation_state=state_list,\n
default_aggregate_uid=software_instance.getUid(),\n
default_resource_uid=service_uid_list,\n
sort_on=((\'movement.start_date\', \'DESC\'),),\n
limit=1,\n
)\n
\n
return packing_list_line\n
]]>
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
service_relative_url=None, portal_type="Sale Packing List Line"
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SoftwareInstance_getInstancePackingListLine
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SoftwareInstance_getStatus.xml
View file @
1a2b4552
...
@@ -50,58 +50,39 @@
...
@@ -50,58 +50,39 @@
</item>
</item>
<item>
<item>
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<value>
<string>
"""Dirty script to return Software Instance state"""\n
"""Dirty script to return Software Instance state"""\n
if context.getPortalType() == "Sale Order Line":\n
if context.getPortalType() == "Sale Order Line":\n
return "Under Approval"\n
return "Under Approval"\n
\n
else:\n
sale_packing_list_line = context.SoftwareInstance_getInstancePackingListLine()\n
state = context.getSlapState()\n
if sale_packing_list_line is None:\n
has_partition = context.getAggregate(portal_type="Computer Partition")\n
sale_packing_list_line = context.SoftwareInstance_getInstancePackingListLine(portal_type="Sale Order Line")\n
if state in ["start_requested", "stop_requested"]:\n
if sale_packing_list_line is None:\n
if not has_partition:\n
if context.getPortalObject().portal_catalog.countResults(\n
portal_type=\'Sale Order Line\',\n
simulation_state=\'cancelled\',\n
default_aggregate_uid=context.getUid(),\n
default_resource_uid=context.restrictedTraverse(context.getPortalObject().portal_preferences.getPreferredInstanceSetupResource()).getUid()\n
)[0][0] >
0:\n
return \'Destroyed\'\n
# Let\'s hope the sale order is not indexed yet\n
return \'Looking for a free partition\'\n
\n
service_url = sale_packing_list_line.getResource()\n
\n
portal_preferences = context.getPortalObject().portal_preferences\n
simulation_state = sale_packing_list_line.getSimulationState()\n
if service_url == portal_preferences.getPreferredInstanceSetupResource():\n
if simulation_state == \'delivered\':\n
return \'Destroyed\'\n
elif simulation_state in (\'confirmed\', ):\n
return \'Waiting for partition instanciation\'\n
elif simulation_state in (\'started\', ):\n
return \'Instanciation in progress\'\n
elif simulation_state in (\'ordered\', ):\n
return \'Looking for a free partition\'\n
return \'Looking for a free partition\'\n
return \'Stopped\'\n
else:\n
elif service_url == portal_preferences.getPreferredInstanceCleanupResource():\n
delivery = context.getCausalityValue()\n
if simulation_state == \'delivered\':\n
delivery_state = delivery.getSimulationState()\n
return \'Destroyed\'\n
if state == "start_requested":\n
return \'Destruction in progress\'\n
if delivery_state in ["confirmed", "started"]:\n
elif service_url == portal_preferences.getPreferredInstanceHostingResource():\n
if simulation_state == \'confirmed\':\n
return \'Start in progress\'\n
return \'Start in progress\'\n
elif simulation_state == \'started\'
:\n
else
:\n
return \'Started\'\n
return \'Started\'\n
elif simulation_state == \'stopped\':\n
\n
elif state == "stop_requested":\n
if delivery_state in ["confirmed", "started"]:\n
return \'Stop in progress\'\n
return \'Stop in progress\'\n
elif simulation_state == \'delivered\'
:\n
else
:\n
return \'Stopped\'\n
return \'Stopped\'\n
\n
\n
return \'Unable to calculate the status...\'\n
elif state in ["destroy_requested"]:\n
if has_partition:\n
return \'Destruction in progress\'\n
]]>
</string>
</value>
else:\n
return \'Destroyed\'\n
\n
else:\n
return \'Unable to calculate the status...\'\n
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
...
...
master/bt5/vifib_slap/bt/revision
View file @
1a2b4552
744
745
\ No newline at end of file
\ 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