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
Labels
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
63cc4b06
Commit
63cc4b06
authored
Aug 29, 2022
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapgrid: get Partition before processing it in report
parent
74983ca7
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 @
63cc4b06
...
...
@@ -1979,6 +1979,12 @@ stderr_logfile_backups=1
# Try to process it anyway, it may need to be deleted.
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
(
software_path
=
software_path
,
instance_path
=
os
.
path
.
join
(
self
.
instance_root
,
...
...
slapos/tests/test_slapgrid.py
View file @
63cc4b06
...
...
@@ -2042,10 +2042,11 @@ class TestSlapgridUsageReport(MasterMixin, unittest.TestCase):
self
.
assertEqual
(
computer
.
sequence
,
[
'/api/allDocs/'
,
'/api/get/'
,
'/api/put/'
,
'/api/put/'
])
self
.
assertEqual
(
instance
.
sequence
[
0
][
1
][
"reported_state"
],
'stopped'
)
self
.
assertEqual
(
instance
.
sequence
[
1
][
1
][
"reported_state"
],
'destroyed'
)
self
.
assertEqual
(
instance
.
sequence
[
1
][
1
][
"reported_state"
],
'stopped'
)
self
.
assertEqual
(
instance
.
sequence
[
2
][
1
][
"reported_state"
],
'destroyed'
)
self
.
assertEqual
(
instance
.
state
,
'destroyed'
)
def
test_partition_list_is_complete_if_empty_destroyed_partition
(
self
):
...
...
@@ -2076,10 +2077,11 @@ class TestSlapgridUsageReport(MasterMixin, unittest.TestCase):
self
.
assertEqual
(
computer
.
sequence
,
[
'/api/allDocs/'
,
'/api/get/'
,
'/api/put/'
,
'/api/put/'
])
self
.
assertEqual
(
instance
.
sequence
[
0
][
1
][
"reported_state"
],
'stopped'
)
self
.
assertEqual
(
instance
.
sequence
[
1
][
1
][
"reported_state"
],
'destroyed'
)
self
.
assertEqual
(
instance
.
sequence
[
1
][
1
][
"reported_state"
],
'stopped'
)
self
.
assertEqual
(
instance
.
sequence
[
2
][
1
][
"reported_state"
],
'destroyed'
)
self
.
assertEqual
(
instance
.
state
,
'destroyed'
)
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