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
41cdc016
Commit
41cdc016
authored
Jul 20, 2022
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip: slapgrid add property to use old api
parent
1eadb8f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+11
-9
No files found.
slapos/grid/slapgrid.py
View file @
41cdc016
...
...
@@ -397,6 +397,10 @@ class Slapgrid(object):
self
.
slap
.
initializeConnection
(
self
.
master_url
,
key_file
=
self
.
key_file
,
cert_file
=
self
.
cert_file
,
master_ca_file
=
self
.
master_ca_file
,
slapgrid_jio_uri
=
self
.
slapgrid_jio_uri
)
if
self
.
slap
.
jio_api_connector
:
self
.
api_backward_compatibility
=
False
else
:
self
.
api_backward_compatibility
=
True
self
.
computer
=
self
.
slap
.
registerComputer
(
self
.
computer_id
)
# Defines all needed paths
self
.
buildout
=
buildout
...
...
@@ -559,7 +563,7 @@ stderr_logfile_backups=1
self
.
logger
.
info
(
'Processing software releases...'
)
# Boolean to know if every instance has correctly been deployed
clean_run
=
True
if
self
.
slap
.
jio_api_connector
:
if
not
self
.
api_backward_compatibility
:
software_installation_list
=
self
.
slap
.
jio_api_connector
.
allDocs
({
"portal_type"
:
"Software Installation"
,
"compute_node_id"
:
self
.
computer_id
...
...
@@ -568,7 +572,6 @@ stderr_logfile_backups=1
software_installation_list
=
software_installation_list
[
"result_list"
]
else
:
software_installation_list
=
[]
backward_compatibility
=
False
else
:
software_installation_list
=
[]
for
software_release
in
self
.
computer
.
getSoftwareReleaseList
():
...
...
@@ -577,7 +580,6 @@ stderr_logfile_backups=1
"state"
:
software_release
.
getState
(),
"compatibility_software_release"
:
software_release
,
})
backward_compatibility
=
True
for
software_release
in
software_installation_list
:
state
=
software_release
[
"state"
]
try
:
...
...
@@ -623,7 +625,7 @@ stderr_logfile_backups=1
url_hash
in
self
.
software_release_filter_list
or
url_hash
in
(
md5digest
(
uri
)
for
uri
in
self
.
software_release_filter_list
)):
try
:
if
not
backward_compatibility
:
if
not
self
.
api_
backward_compatibility
:
self
.
slap
.
jio_api_connector
.
put
({
"portal_type"
:
"Software Installation"
,
"compute_node_id"
:
self
.
computer_id
,
...
...
@@ -648,7 +650,7 @@ stderr_logfile_backups=1
manager
.
softwareTearDown
(
software
)
# Send log before exiting
except
(
SystemExit
,
KeyboardInterrupt
):
if
not
backward_compatibility
:
if
not
self
.
api_
backward_compatibility
:
self
.
slap
.
jio_api_connector
.
put
({
"portal_type"
:
"Software Installation"
,
"compute_node_id"
:
self
.
computer_id
,
...
...
@@ -665,7 +667,7 @@ stderr_logfile_backups=1
except
BuildoutFailedError
as
exc
:
clean_run
=
False
try
:
if
not
backward_compatibility
:
if
not
self
.
api_
backward_compatibility
:
self
.
slap
.
jio_api_connector
.
put
({
"portal_type"
:
"Software Installation"
,
"compute_node_id"
:
self
.
computer_id
,
...
...
@@ -682,7 +684,7 @@ stderr_logfile_backups=1
# For everything else: log it, send it, continue.
except
Exception
:
self
.
logger
.
exception
(
''
)
if
not
backward_compatibility
:
if
not
self
.
api_
backward_compatibility
:
self
.
slap
.
jio_api_connector
.
put
({
"portal_type"
:
"Software Installation"
,
"compute_node_id"
:
self
.
computer_id
,
...
...
@@ -697,7 +699,7 @@ stderr_logfile_backups=1
else
:
if
state
==
'available'
:
try
:
if
not
backward_compatibility
:
if
not
self
.
api_
backward_compatibility
:
self
.
slap
.
jio_api_connector
.
put
({
"portal_type"
:
"Software Installation"
,
"compute_node_id"
:
self
.
computer_id
,
...
...
@@ -710,7 +712,7 @@ stderr_logfile_backups=1
pass
elif
state
==
'destroyed'
:
try
:
if
not
backward_compatibility
:
if
not
self
.
api_
backward_compatibility
:
self
.
slap
.
jio_api_connector
.
put
({
"portal_type"
:
"Software Installation"
,
"compute_node_id"
:
self
.
computer_id
,
...
...
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