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
Cédric Le Ninivin
slapos.core
Commits
21fdbbc4
Commit
21fdbbc4
authored
Jul 29, 2022
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapgrid: wip continue working on new API
parent
d37500fe
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
233 additions
and
129 deletions
+233
-129
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+19
-20
slapos/tests/test_slapgrid.py
slapos/tests/test_slapgrid.py
+214
-109
No files found.
slapos/grid/slapgrid.py
View file @
21fdbbc4
...
@@ -1730,7 +1730,6 @@ stderr_logfile_backups=1
...
@@ -1730,7 +1730,6 @@ stderr_logfile_backups=1
self
.
checkEnvironmentAndCreateStructure
()
self
.
checkEnvironmentAndCreateStructure
()
self
.
_launchSupervisord
()
self
.
_launchSupervisord
()
slap_computer_usage
=
self
.
slap
.
registerComputer
(
self
.
computer_id
)
computer_partition_usage_list
=
[]
computer_partition_usage_list
=
[]
self
.
logger
.
info
(
'Aggregating and sending usage reports...'
)
self
.
logger
.
info
(
'Aggregating and sending usage reports...'
)
...
@@ -1760,7 +1759,7 @@ stderr_logfile_backups=1
...
@@ -1760,7 +1759,7 @@ stderr_logfile_backups=1
clean_run
=
True
clean_run
=
True
# Loop over the different computer partitions
# Loop over the different computer partitions
computer_partition_list
=
self
.
FilterComputerPartitionList
(
computer_partition_list
=
self
.
FilterComputerPartitionList
(
s
lap_computer_usage
.
getComputerPartitionList
())
s
elf
.
getComputerPartitionList
())
for
computer_partition
in
computer_partition_list
:
for
computer_partition
in
computer_partition_list
:
try
:
try
:
...
@@ -1895,7 +1894,7 @@ stderr_logfile_backups=1
...
@@ -1895,7 +1894,7 @@ stderr_logfile_backups=1
if
self
.
validateXML
(
usage
,
computer_consumption_model
):
if
self
.
validateXML
(
usage
,
computer_consumption_model
):
self
.
logger
.
info
(
'XML file generated by asXML is valid'
)
self
.
logger
.
info
(
'XML file generated by asXML is valid'
)
s
lap_computer_usage
.
reportUsage
(
usage
)
s
elf
.
computer
.
reportUsage
(
usage
)
filename_delete_list
.
append
(
filename
)
filename_delete_list
.
append
(
filename
)
else
:
else
:
self
.
logger
.
info
(
'XML file is invalid %s'
%
file_path
)
self
.
logger
.
info
(
'XML file is invalid %s'
%
file_path
)
...
@@ -1915,7 +1914,7 @@ stderr_logfile_backups=1
...
@@ -1915,7 +1914,7 @@ stderr_logfile_backups=1
# We test the XML report before sending it
# We test the XML report before sending it
if
self
.
validateXML
(
computer_consumption
,
computer_consumption_model
):
if
self
.
validateXML
(
computer_consumption
,
computer_consumption_model
):
self
.
logger
.
info
(
'XML file generated by asXML is valid'
)
self
.
logger
.
info
(
'XML file generated by asXML is valid'
)
s
lap_computer_usage
.
reportUsage
(
computer_consumption
)
s
elf
.
computer
.
reportUsage
(
computer_consumption
)
else
:
else
:
self
.
logger
.
info
(
'XML file generated by asXML is not valid !'
)
self
.
logger
.
info
(
'XML file generated by asXML is not valid !'
)
raise
ValueError
(
'XML file generated by asXML is not valid !'
)
raise
ValueError
(
'XML file generated by asXML is not valid !'
)
...
@@ -1967,7 +1966,7 @@ stderr_logfile_backups=1
...
@@ -1967,7 +1966,7 @@ stderr_logfile_backups=1
self
.
slap
.
jio_api_connector
.
put
({
self
.
slap
.
jio_api_connector
.
put
({
"portal_type"
:
"Software Instance"
,
"portal_type"
:
"Software Instance"
,
"reference"
:
computer_partition
.
get
(
"reference"
),
"reference"
:
computer_partition
.
get
(
"reference"
),
"reported_state"
:
"start
ed"
"reported_state"
:
"stopp
ed"
})
})
else
:
else
:
computer_partition
[
"slap_partition"
].
stopped
()
computer_partition
[
"slap_partition"
].
stopped
()
...
...
slapos/tests/test_slapgrid.py
View file @
21fdbbc4
This diff is collapsed.
Click to expand it.
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