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
8123754c
Commit
8123754c
authored
May 23, 2022
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: allocation scope is meaningless to restrict allocation permission
parent
26b56696
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
21 deletions
+1
-21
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputePartition_isFreeForRequest.py
...l_skins/slapos_cloud/ComputePartition_isFreeForRequest.py
+1
-1
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Person_findPartition.py
...ateItem/portal_skins/slapos_cloud/Person_findPartition.py
+0
-20
No files found.
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputePartition_isFreeForRequest.py
View file @
8123754c
if
context
.
getPortalObject
().
portal_workflow
.
isTransitionPossible
(
context
,
'mark_busy'
)
and
context
.
getParentValue
().
isMemberOf
(
'allocation_scope/open'
)
:
if
context
.
getPortalObject
().
portal_workflow
.
isTransitionPossible
(
context
,
'mark_busy'
):
return
1
return
0
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Person_findPartition.py
View file @
8123754c
import
random
from
Products.ZSQLCatalog.SQLCatalog
import
SimpleQuery
,
ComplexQuery
person
=
context
portal
=
context
.
getPortalObject
()
def
getOpenAllocationScopeUidList
(
exclude_uid_list
):
return
[
scope
.
getUid
()
for
scope
in
portal
.
portal_categories
.
allocation_scope
.
open
.
objectValues
()
if
scope
.
getUid
()
not
in
exclude_uid_list
]
compute_partition
=
None
...
...
@@ -88,21 +83,6 @@ for base_category in compute_node_base_category_list:
else
:
query_kw
[
"%s_uid"
%
base_category
]
=
category
.
getUid
()
query_kw
[
"capacity_scope_uid"
]
=
portal
.
portal_categories
.
capacity_scope
.
open
.
getUid
()
if
subscription_reference
is
not
None
and
software_instance_portal_type
!=
"Slave Instance"
:
# Subscriptions uses a specific set of allocation scope
query_kw
[
"allocation_scope_uid"
]
=
portal
.
portal_categories
.
allocation_scope
.
open
.
subscription
.
getUid
()
elif
subscription_reference
is
not
None
and
\
software_instance_portal_type
==
"Slave Instance"
and
\
is_root_slave
:
# Subscriptions uses a specific set of allocation scope
query_kw
[
"allocation_scope_uid"
]
=
getOpenAllocationScopeUidList
([])
else
:
# else pic anything but open/subscription
query_kw
[
"allocation_scope_uid"
]
=
getOpenAllocationScopeUidList
(
exclude_uid_list
=
[
portal
.
portal_categories
.
allocation_scope
.
open
.
subscription
.
getUid
()])
extra_query_kw
=
context
.
ComputePartition_getCustomAllocationParameterDict
(
software_release_url
,
software_type
,
software_instance_portal_type
,
filter_kw_copy
,
computer_network_query
,
test_mode
)
...
...
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