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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
3fa1a0c2
Commit
3fa1a0c2
authored
Nov 08, 2022
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: configure Allocation Supply Cell predicate
parent
f8f9e803
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
4 deletions
+81
-4
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/AllocationSupplyCell_asPredicate.py
...al_skins/slapos_cloud/AllocationSupplyCell_asPredicate.py
+15
-0
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/AllocationSupplyCell_asPredicate.xml
...l_skins/slapos_cloud/AllocationSupplyCell_asPredicate.xml
+62
-0
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Person_findPartition.py
...ateItem/portal_skins/slapos_cloud/Person_findPartition.py
+4
-4
No files found.
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/AllocationSupplyCell_asPredicate.py
0 → 100644
View file @
3fa1a0c2
line
=
context
.
getParentValue
()
supply
=
line
.
getParentValue
()
if
(
supply
.
getPortalType
()
!=
'Allocation Supply'
)
or
(
supply
.
getValidationState
()
!=
'validated'
):
return
None
if
not
context
.
isAllocable
():
return
None
base_category_tuple
=
(
'resource'
,
'software_type'
,
'software_release'
,
'destination_project'
)
if
supply
.
getDestination
():
base_category_tuple
+=
(
'destination'
,)
return
context
.
generatePredicate
(
membership_criterion_base_category_list
=
base_category_tuple
,
criterion_property_list
=
(
'start_date'
,))
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/AllocationSupplyCell_asPredicate.xml
0 → 100644
View file @
3fa1a0c2
<?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>
_params
</string>
</key>
<value>
<string>
*args,**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
AllocationSupplyCell_asPredicate
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Person_findPartition.py
View file @
3fa1a0c2
...
...
@@ -46,15 +46,15 @@ tmp_context = portal.portal_trash.newContent(
resource_value
=
software_product
,
software_type_value
=
type_variation
,
software_release_value
=
release_variation
,
destination_value
=
context
,
destination_project_value
=
software_product
.
getFollowUpValue
(),
start_date
=
DateTime
()
)
allocation_cell_list
=
[
x
.
getObject
()
for
x
in
\
domain_tool
.
searchPredicateList
(
tmp_context
,
portal_type
=
[
'Allocation Supply Cell'
],
validation_state
=
'validated'
,
destination_project__uid
=
project_uid
,
tested_base_category_list
=
[
'resource'
,
'software_type'
,
'software_release'
])
if
x
.
isAllocable
()]
tmp_context
,
portal_type
=
[
'Allocation Supply Cell'
])
if
x
.
isAllocable
()]
#context.log('allocation_cell_list %s' % str(allocation_cell_list))
if
not
allocation_cell_list
:
...
...
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