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
Léo-Paul Géneau
slapos.core
Commits
956feb77
Commit
956feb77
authored
Feb 01, 2023
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapgrid: Move to new allDocs structure and use get_parameters
parent
66912dd6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
21 deletions
+52
-21
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+4
-16
slapos/tests/test_slapgrid.py
slapos/tests/test_slapgrid.py
+48
-5
No files found.
slapos/grid/slapgrid.py
View file @
956feb77
...
@@ -1127,10 +1127,7 @@ stderr_logfile_backups=1
...
@@ -1127,10 +1127,7 @@ stderr_logfile_backups=1
}).
get
(
"result_list"
,
[])
}).
get
(
"result_list"
,
[])
for
instance_result
in
related_instance_list
:
for
instance_result
in
related_instance_list
:
if
instance_result
[
"reference"
]
!=
computer_partition
[
"reference"
]:
if
instance_result
[
"reference"
]
!=
computer_partition
[
"reference"
]:
instance
=
self
.
slap
.
jio_api_connector
.
get
({
instance
=
self
.
slap
.
jio_api_connector
.
get
(
instance_result
[
"get_parameters"
])
"portal_type"
:
"Software Instance"
,
"reference"
:
instance_result
[
"reference"
],
})
hosting_ip_list
=
hosting_ip_list
+
instance
[
"ip_list"
]
hosting_ip_list
=
hosting_ip_list
+
instance
[
"ip_list"
]
else
:
else
:
hosting_ip_list
=
computer_partition
[
"slap_partition"
].
getFullHostingIpAddressList
()
hosting_ip_list
=
computer_partition
[
"slap_partition"
].
getFullHostingIpAddressList
()
...
@@ -1609,10 +1606,7 @@ stderr_logfile_backups=1
...
@@ -1609,10 +1606,7 @@ stderr_logfile_backups=1
# even if something is terribly wrong while processing an instance, it
# even if something is terribly wrong while processing an instance, it
# won't prevent processing other ones.
# won't prevent processing other ones.
if
not
self
.
api_backward_compatibility
:
if
not
self
.
api_backward_compatibility
:
computer_partition
=
self
.
slap
.
jio_api_connector
.
get
({
computer_partition
=
self
.
slap
.
jio_api_connector
.
get
(
computer_partition
[
"get_parameters"
])
"portal_type"
:
"Software Instance"
,
"reference"
:
computer_partition
[
"reference"
]
})
try
:
try
:
# Process the partition itself
# Process the partition itself
self
.
processComputerPartition
(
computer_partition
)
self
.
processComputerPartition
(
computer_partition
)
...
@@ -1685,10 +1679,7 @@ stderr_logfile_backups=1
...
@@ -1685,10 +1679,7 @@ stderr_logfile_backups=1
promise_error_partition_list
=
[]
promise_error_partition_list
=
[]
for
computer_partition
in
computer_partition_list
:
for
computer_partition
in
computer_partition_list
:
if
not
self
.
api_backward_compatibility
:
if
not
self
.
api_backward_compatibility
:
computer_partition
=
self
.
slap
.
jio_api_connector
.
get
({
computer_partition
=
self
.
slap
.
jio_api_connector
.
get
(
computer_partition
[
"get_parameters"
])
"portal_type"
:
"Software Instance"
,
"reference"
:
computer_partition
[
"reference"
]
})
try
:
try
:
# Process the partition itself
# Process the partition itself
self
.
processPromise
(
computer_partition
)
self
.
processPromise
(
computer_partition
)
...
@@ -2001,10 +1992,7 @@ stderr_logfile_backups=1
...
@@ -2001,10 +1992,7 @@ stderr_logfile_backups=1
software_path
=
None
software_path
=
None
if
not
self
.
api_backward_compatibility
:
if
not
self
.
api_backward_compatibility
:
computer_partition
=
self
.
slap
.
jio_api_connector
.
get
({
computer_partition
=
self
.
slap
.
jio_api_connector
.
get
(
computer_partition
[
"get_parameters"
])
"portal_type"
:
"Software Instance"
,
"reference"
:
computer_partition
[
"reference"
]
})
local_partition
=
Partition
(
local_partition
=
Partition
(
software_path
=
software_path
,
software_path
=
software_path
,
...
...
slapos/tests/test_slapgrid.py
View file @
956feb77
...
@@ -442,46 +442,85 @@ class ComputerForTest(object):
...
@@ -442,46 +442,85 @@ class ComputerForTest(object):
if
(
url
.
path
==
'/api/allDocs/'
):
if
(
url
.
path
==
'/api/allDocs/'
):
if
content
[
"portal_type"
]
==
"Software Installation"
:
if
content
[
"portal_type"
]
==
"Software Installation"
:
return
json
.
dumps
({
return
json
.
dumps
({
"current_page_full"
:
False
,
"next_page_request"
:
{
"portal_type"
:
"Software Installation"
,
"compute_node_id"
:
content
[
"compute_node_id"
],
},
"result_list"
:
[{
"result_list"
:
[{
"software_release_uri"
:
x
.
name
,
"software_release_uri"
:
x
.
name
,
"portal_type"
:
"Software Installation"
,
"portal_type"
:
"Software Installation"
,
"compute_node_id"
:
content
[
"compute_node_id"
],
"compute_node_id"
:
content
[
"compute_node_id"
],
"state"
:
x
.
requested_state
"state"
:
x
.
requested_state
,
"api_revision"
:
"12121"
,
"get_parameters"
:
{
"software_release_uri"
:
x
.
name
,
"portal_type"
:
"Software Installation"
,
"compute_node_id"
:
content
[
"compute_node_id"
],
}
}
for
x
in
self
.
software_list
]
}
for
x
in
self
.
software_list
]
})
})
if
content
[
"portal_type"
]
==
"Software Instance"
:
if
content
[
"portal_type"
]
==
"Software Instance"
:
if
"compute_node_id"
in
content
:
if
"compute_node_id"
in
content
:
if
"compute_partition_id"
in
content
:
if
"compute_partition_id"
in
content
:
return
json
.
dumps
({
return
json
.
dumps
({
"current_page_full"
:
False
,
"next_page_request"
:
{
"portal_type"
:
"Software Instance"
,
"compute_partition_id"
:
content
[
"compute_partition_id"
],
},
"result_list"
:
[{
"result_list"
:
[{
"software_release_uri"
:
x
.
software
.
name
if
x
.
software
else
None
,
"software_release_uri"
:
x
.
software
.
name
if
x
.
software
else
None
,
"reference"
:
x
.
name
,
"reference"
:
x
.
name
,
"title"
:
x
.
name
,
"title"
:
x
.
name
,
"portal_type"
:
"Software Instance"
,
"portal_type"
:
"Software Instance"
,
"compute_partition_id"
:
x
.
name
,
"compute_partition_id"
:
x
.
name
,
"state"
:
x
.
requested_state
"state"
:
x
.
requested_state
,
"api_revision"
:
"12132"
,
"get_parameters"
:
{
"portal_type"
:
"Software Instance"
,
"reference"
:
x
.
name
,
}
}
for
x
in
self
.
instance_list
if
x
.
name
==
content
[
"compute_partition_id"
]]
}
for
x
in
self
.
instance_list
if
x
.
name
==
content
[
"compute_partition_id"
]]
})
})
else
:
else
:
return
json
.
dumps
({
return
json
.
dumps
({
"current_page_full"
:
False
,
"next_page_request"
:
{
"portal_type"
:
"Software Instance"
,
"compute_node_id"
:
content
[
"compute_node_id"
],
},
"result_list"
:
[{
"result_list"
:
[{
"software_release_uri"
:
x
.
software
.
name
if
x
.
software
else
None
,
"software_release_uri"
:
x
.
software
.
name
if
x
.
software
else
None
,
"reference"
:
x
.
name
,
"reference"
:
x
.
name
,
"title"
:
x
.
name
,
"title"
:
x
.
name
,
"portal_type"
:
"Software Instance"
,
"portal_type"
:
"Software Instance"
,
"compute_partition_id"
:
x
.
name
,
"compute_partition_id"
:
x
.
name
,
"state"
:
x
.
requested_state
"state"
:
x
.
requested_state
,
"get_parameters"
:
{
"portal_type"
:
"Software Instance"
,
"reference"
:
x
.
name
,
}
}
for
x
in
self
.
instance_list
]
}
for
x
in
self
.
instance_list
]
})
})
elif
"root_instance_title"
in
content
:
elif
"root_instance_title"
in
content
:
return
json
.
dumps
({
return
json
.
dumps
({
"current_page_full"
:
False
,
"next_page_request"
:
{
"portal_type"
:
"Software Instance"
,
"root_instance_title"
:
content
[
"root_instance_title"
],
},
"result_list"
:
[{
"result_list"
:
[{
"software_release_uri"
:
x
.
software
.
name
if
x
.
software
else
None
,
"software_release_uri"
:
x
.
software
.
name
if
x
.
software
else
None
,
"reference"
:
x
.
name
,
"reference"
:
x
.
name
,
"title"
:
x
.
name
,
"title"
:
x
.
name
,
"portal_type"
:
"Software Instance"
,
"portal_type"
:
"Software Instance"
,
"compute_partition_id"
:
x
.
name
,
"compute_partition_id"
:
x
.
name
,
"state"
:
x
.
requested_state
"state"
:
x
.
requested_state
,
"get_parameters"
:
{
"portal_type"
:
"Software Instance"
,
"reference"
:
x
.
name
,
},
}
for
x
in
self
.
instance_list
]
+
[
}
for
x
in
self
.
instance_list
]
+
[
{
{
"software_release_uri"
:
"foo.cfg"
,
"software_release_uri"
:
"foo.cfg"
,
...
@@ -489,7 +528,11 @@ class ComputerForTest(object):
...
@@ -489,7 +528,11 @@ class ComputerForTest(object):
"title"
:
"related_instance"
,
"title"
:
"related_instance"
,
"portal_type"
:
"Software Instance"
,
"portal_type"
:
"Software Instance"
,
"compute_partition_id"
:
"related_instance"
,
"compute_partition_id"
:
"related_instance"
,
"state"
:
"stopped"
"state"
:
"stopped"
,
"get_parameters"
:
{
"portal_type"
:
"Software Instance"
,
"reference"
:
"related_instance"
,
}
}
}
]
]
})
})
...
...
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