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
Roque
slapos.core
Commits
6b53d073
Commit
6b53d073
authored
Jun 11, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_panel: simplify script
All outdated items should have a validation_state to validated
parent
40affc42
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
20 deletions
+4
-20
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Project_getComputeNodeTrackingList.py
..._skins/slapos_panel/Project_getComputeNodeTrackingList.py
+4
-20
No files found.
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Project_getComputeNodeTrackingList.py
View file @
6b53d073
# This script might not be efficient to a large quantities of
# Compute Nodes
from
DateTime
import
DateTime
kw
.
update
({
"follow_up_uid"
:
context
.
getUid
(),
"portal_type"
:
[
'Instance Node'
,
'Remote Node'
,
'Compute Node'
,
'Instance Tree'
,
'Computer Network'
]
"follow_up__uid"
:
context
.
getUid
(),
"portal_type"
:
[
'Instance Node'
,
'Remote Node'
,
'Compute Node'
,
'Instance Tree'
,
'Computer Network'
],
"validation_state"
:
"validated"
})
def
filter_per_portal_type
(
document
):
if
document
.
getPortalType
()
==
"Compute Node"
\
and
document
.
getAllocationScope
()
!=
"close/forever"
:
return
document
elif
document
.
getPortalType
()
==
"Instance Tree"
\
and
document
.
getSlapState
()
!=
"destroy_requested"
:
return
document
elif
document
.
getPortalType
()
==
"Computer Network"
\
and
document
.
getValidationState
()
==
"validated"
:
return
document
return
[
i
.
getObject
()
for
i
in
context
.
getPortalObject
().
portal_catalog
(
**
kw
)
if
filter_per_portal_type
(
i
.
getObject
())]
return
context
.
getPortalObject
().
portal_catalog
(
**
kw
)
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