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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.core
Commits
3c62e552
Commit
3c62e552
authored
Mar 27, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide more generic script to find delivery lines.
parent
05a910a3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
109 additions
and
40 deletions
+109
-40
master/bt5/vifib_slap/WorkflowTemplateItem/portal_workflow/computer_slap_interface_workflow/scripts/Computer_getSoftwarePackingListLineList.xml
...kflow/scripts/Computer_getSoftwarePackingListLineList.xml
+101
-0
master/bt5/vifib_slap/WorkflowTemplateItem/portal_workflow/computer_slap_interface_workflow/scripts/Computer_getSoftwareSetupPackingListLine.xml
...flow/scripts/Computer_getSoftwareSetupPackingListLine.xml
+7
-39
master/bt5/vifib_slap/bt/revision
master/bt5/vifib_slap/bt/revision
+1
-1
No files found.
master/bt5/vifib_slap/WorkflowTemplateItem/portal_workflow/computer_slap_interface_workflow/scripts/Computer_getSoftwarePackingListLineList.xml
0 → 100644
View file @
3c62e552
<?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>
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
\n
computer = state_change[\'object\']\n
# Get required arguments\n
kwargs = state_change.kwargs\n
software_release_url = state_change.kwargs["software_release_url"]\n
\n
portal = computer.getPortalObject()\n
\n
# Only get one software release\n
software_release_document_result = computer.portal_catalog(\n
portal_type=\'Software Release\', # validation_state=(\'shared\', \'released\', \'published\', \'shared_alive\', \'released_alive\', \'published_alive\'),\n
url_string=software_release_url, limit=2)\n
if len(software_release_document_result) != 1:\n
raise ValueError("No software release found for %s %s" % (computer.getRelativeUrl(), software_release_url))\n
else:\n
software_release_document = software_release_document_result[0]\n
\n
# Packing List valid state\n
if state_list is None:\n
state_list = []\n
state_list.extend(portal.getPortalReservedInventoryStateList())\n
state_list.extend(portal.getPortalTransitInventoryStateList())\n
\n
return portal.portal_catalog(\n
portal_type=\'Purchase Packing List Line\',\n
simulation_state=state_list,\n
default_resource_uid=service_uid_list,\n
sort_on=((\'movement.start_date\', \'DESC\'),),\n
aggregate_relative_url=ComplexQuery(\n
Query(aggregate_relative_url=software_release_document.getRelativeUrl()),\n
Query(aggregate_relative_url=computer.getRelativeUrl()),\n
operator="AND"),\n
limit=limit\n
)\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
state_change, service_uid_list, state_list=None, limit=1
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Computer_getSoftwarePackingListLineList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slap/WorkflowTemplateItem/portal_workflow/computer_slap_interface_workflow/scripts/Computer_getSoftwareSetupPackingListLine.xml
View file @
3c62e552
...
@@ -52,47 +52,15 @@
...
@@ -52,47 +52,15 @@
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string>
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
<value>
<string>
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
\n
\n
computer = state_change[\'object\']\n
portal = context.getPortalObject()\n
# Get required arguments\n
packing_list_line_list = context.Computer_getSoftwarePackingListLineList(\n
kwargs = state_change.kwargs\n
state_change,\n
software_release_url = state_change.kwargs["software_release_url"]\n
service_uid_list=[portal.restrictedTraverse(portal.portal_preferences.getPreferredSoftwareSetupResource()).getUid()],\n
\n
limit=1)\n
portal = computer.getPortalObject()\n
if len(packing_list_line_list) == 0:\n
\n
# Only get one software release\n
software_release_document_result = computer.portal_catalog(\n
portal_type=\'Software Release\', # validation_state=(\'shared\', \'released\', \'published\', \'shared_alive\', \'released_alive\', \'published_alive\'),\n
url_string=software_release_url, limit=2)\n
if len(software_release_document_result) != 1:\n
raise ValueError("No software release found for %s %s" % (computer.getRelativeUrl(), software_release_url))\n
else:\n
software_release_document = software_release_document_result[0]\n
\n
# Software installation service\n
service_relative_url = portal.portal_preferences.\\\n
getPreferredSoftwareSetupResource()\n
service = portal.restrictedTraverse(service_relative_url)\n
service_uid = service.getUid()\n
\n
# Packing List valid state\n
state_list = []\n
state_list.extend(portal.getPortalReservedInventoryStateList())\n
state_list.extend(portal.getPortalTransitInventoryStateList())\n
\n
packing_list_line = portal.portal_catalog.getResultValue(\n
portal_type=\'Purchase Packing List Line\',\n
simulation_state=state_list,\n
default_resource_uid=service_uid,\n
sort_on=((\'movement.start_date\', \'DESC\'),),\n
aggregate_relative_url=ComplexQuery(\n
Query(aggregate_relative_url=software_release_document.getRelativeUrl()),\n
Query(aggregate_relative_url=computer.getRelativeUrl()),\n
operator="AND"),\n
)\n
if packing_list_line is None:\n
raise ValueError("No purchase packing list line found for %s %s" % (computer.getRelativeUrl(), software_release_document.getRelativeUrl()))\n
raise ValueError("No purchase packing list line found for %s %s" % (computer.getRelativeUrl(), software_release_document.getRelativeUrl()))\n
else:\n
else:\n
return packing_list_line\n
return packing_list_line
_list[0].getObject()
\n
</string>
</value>
</string>
</value>
</item>
</item>
<item>
<item>
...
...
master/bt5/vifib_slap/bt/revision
View file @
3c62e552
676
677
\ 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