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
Paul Graydon
slapos.core
Commits
206c02df
Commit
206c02df
authored
May 25, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop Item_getInstancePackingListLine.
Packing can be fetch from instance directly.
parent
99c8d5ff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
137 deletions
+17
-137
master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_base/ComputerPartition_getAvailableSoftwareReleaseUrlStringList.xml
...terPartition_getAvailableSoftwareReleaseUrlStringList.xml
+8
-15
master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_base/ComputerPartition_getSoftwareType.xml
...al_skins/vifib_base/ComputerPartition_getSoftwareType.xml
+8
-8
master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_base/Item_getInstancePackingListLine.xml
...rtal_skins/vifib_base/Item_getInstancePackingListLine.xml
+0
-113
master/bt5/vifib_base/bt/revision
master/bt5/vifib_base/bt/revision
+1
-1
No files found.
master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_base/ComputerPartition_getAvailableSoftwareReleaseUrlStringList.xml
View file @
206c02df
...
...
@@ -60,22 +60,15 @@ if slap_state == \'free\':\n
\n
elif slap_state == \'busy\':\n
\n
# Partition under destruction does not accept new slave\n
try:\n
delivery_line = context.Item_getInstancePackingListLine(service_relative_url=portal_preferences.getPreferredInstanceCleanupResource(), aggregate_portal_type=\'Software Instance\')\n
except ValueError:\n
pass\n
instance = portal.portal_catalog.getResultValue(\n
portal_type="Software Instance",\n
validation_state="validated",\n
default_aggregate_uid=context.getUid(),\n
)\n
if instance is None:\n
return []\n
else:\n
if delivery_line.getSimulationState() != \'delivered\':\n
return []\n
\n
try:\n
delivery_line = context.Item_getInstancePackingListLine()\n
except ValueError:\n
pass\n
else:\n
software_release = delivery_line.getAggregateValue(portal_type=\'Software Release\')\n
return [software_release.getUrlString()]\n
return [instance.getRootSoftwareReleaseUrl()]\n
\n
else:\n
return []\n
...
...
master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_base/ComputerPartition_getSoftwareType.xml
View file @
206c02df
...
...
@@ -50,15 +50,15 @@
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
try:\n
delivery_line = context.Item_getInstancePackingListLine()\n
except ValueError:\n
pass\n
<value>
<string>
instance = context.getPortalObject().portal_catalog.getResultValue(\n
portal_type="Software Instance",\n
validation_state="validated",\n
default_aggregate_uid=context.getUid(),\n
)\n
if instance is None:\n
return ""\n
else:\n
software_instance = delivery_line.getAggregateValue(portal_type=[\'Software Instance\', \'Slave Instance\'])\n
if software_instance is not None:\n
return software_instance.getSourceReference()\n
return ""\n
return instance.getSourceReference()\n
</string>
</value>
</item>
<item>
...
...
master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_base/Item_getInstancePackingListLine.xml
deleted
100644 → 0
View file @
99c8d5ff
<?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>
# XXX: Copy of software_instance_slap_interface_workflow/scripts/SoftwareInstance_getInstancePackingListLine\n
# XXX: It is not decided yet where to put such method.\n
# XXX: Unfortunately not available outside of workflow\n
item = context\n
\n
portal = item.getPortalObject()\n
\n
# Get services\n
portal_preferences = portal.portal_preferences\n
service_uid_list = []\n
\n
if aggregate_portal_type is None:\n
aggregate_portal_type = [\'Software Instance\', \'Slave Instance\']\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 = []\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=\'Sale Packing List Line\',\n
simulation_state=state_list,\n
aggregate_uid=item.getUid(),\n
default_resource_uid=service_uid_list,\n
sort_on=((\'movement.start_date\', \'DESC\'),),\n
limit=1,\n
aggregate_portal_type=aggregate_portal_type\n
)\n
\n
if packing_list_line is None:\n
raise ValueError("No sale packing list line found for %s" % \\\n
item.getRelativeUrl())\n
else:\n
return packing_list_line\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
service_relative_url=None, aggregate_portal_type=None
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Item_getInstancePackingListLine
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_base/bt/revision
View file @
206c02df
451
\ No newline at end of file
452
\ 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