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
a445c48e
Commit
a445c48e
authored
Aug 29, 2022
by
Cédric Le Ninivin
Committed by
Romain Courteaud
Nov 27, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapgrid: get Partition before processing it in report
parent
53fad571
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+6
-0
slapos/tests/test_slapgrid.py
slapos/tests/test_slapgrid.py
+6
-4
No files found.
slapos/grid/slapgrid.py
View file @
a445c48e
...
@@ -2054,6 +2054,12 @@ stderr_logfile_backups=1
...
@@ -2054,6 +2054,12 @@ stderr_logfile_backups=1
# Try to process it anyway, it may need to be deleted.
# Try to process it anyway, it may need to be deleted.
software_path
=
None
software_path
=
None
if
not
self
.
api_backward_compatibility
:
computer_partition
=
self
.
slap
.
jio_api_connector
.
get
({
"portal_type"
:
"Software Instance"
,
"reference"
:
computer_partition
[
"reference"
]
})
local_partition
=
Partition
(
local_partition
=
Partition
(
software_path
=
software_path
,
software_path
=
software_path
,
instance_path
=
os
.
path
.
join
(
self
.
instance_root
,
instance_path
=
os
.
path
.
join
(
self
.
instance_root
,
...
...
slapos/tests/test_slapgrid.py
View file @
a445c48e
...
@@ -2218,10 +2218,11 @@ class TestSlapgridUsageReport(MasterMixin, unittest.TestCase):
...
@@ -2218,10 +2218,11 @@ class TestSlapgridUsageReport(MasterMixin, unittest.TestCase):
self
.
assertEqual
(
computer
.
sequence
,
self
.
assertEqual
(
computer
.
sequence
,
[
'/api/allDocs/'
,
[
'/api/allDocs/'
,
'/api/get/'
,
'/api/put/'
,
'/api/put/'
,
'/api/put/'
])
'/api/put/'
])
self
.
assertEqual
(
instance
.
sequence
[
0
][
1
][
"reported_state"
],
'stopped'
)
self
.
assertEqual
(
instance
.
sequence
[
1
][
1
][
"reported_state"
],
'stopped'
)
self
.
assertEqual
(
instance
.
sequence
[
1
][
1
][
"reported_state"
],
'destroyed'
)
self
.
assertEqual
(
instance
.
sequence
[
2
][
1
][
"reported_state"
],
'destroyed'
)
self
.
assertEqual
(
instance
.
state
,
'destroyed'
)
self
.
assertEqual
(
instance
.
state
,
'destroyed'
)
def
test_partition_list_is_complete_if_empty_destroyed_partition
(
self
):
def
test_partition_list_is_complete_if_empty_destroyed_partition
(
self
):
...
@@ -2252,10 +2253,11 @@ class TestSlapgridUsageReport(MasterMixin, unittest.TestCase):
...
@@ -2252,10 +2253,11 @@ class TestSlapgridUsageReport(MasterMixin, unittest.TestCase):
self
.
assertEqual
(
computer
.
sequence
,
self
.
assertEqual
(
computer
.
sequence
,
[
'/api/allDocs/'
,
[
'/api/allDocs/'
,
'/api/get/'
,
'/api/put/'
,
'/api/put/'
,
'/api/put/'
])
'/api/put/'
])
self
.
assertEqual
(
instance
.
sequence
[
0
][
1
][
"reported_state"
],
'stopped'
)
self
.
assertEqual
(
instance
.
sequence
[
1
][
1
][
"reported_state"
],
'stopped'
)
self
.
assertEqual
(
instance
.
sequence
[
1
][
1
][
"reported_state"
],
'destroyed'
)
self
.
assertEqual
(
instance
.
sequence
[
2
][
1
][
"reported_state"
],
'destroyed'
)
self
.
assertEqual
(
instance
.
state
,
'destroyed'
)
self
.
assertEqual
(
instance
.
state
,
'destroyed'
)
def
test_slapgrid_not_destroy_bad_instance
(
self
):
def
test_slapgrid_not_destroy_bad_instance
(
self
):
...
...
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