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
837eb523
Commit
837eb523
authored
Jan 20, 2025
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIPWIP start dropping jio_api_connector
parent
45ebdd88
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
3 additions
and
50 deletions
+3
-50
slapos/format.py
slapos/format.py
+0
-3
slapos/grid/SlapObject.py
slapos/grid/SlapObject.py
+0
-5
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+2
-16
slapos/grid/templates/buildout-tail.cfg.in
slapos/grid/templates/buildout-tail.cfg.in
+0
-1
slapos/slap/slap.py
slapos/slap/slap.py
+1
-23
slapos/tests/test_slapformat.py
slapos/tests/test_slapformat.py
+0
-1
slapos/tests/test_slapgrid.py
slapos/tests/test_slapgrid.py
+0
-1
No files found.
slapos/format.py
View file @
837eb523
...
@@ -364,8 +364,6 @@ class Computer(object):
...
@@ -364,8 +364,6 @@ class Computer(object):
if
conf
.
key_file
and
conf
.
cert_file
:
if
conf
.
key_file
and
conf
.
cert_file
:
connection_dict
[
'key_file'
]
=
conf
.
key_file
connection_dict
[
'key_file'
]
=
conf
.
key_file
connection_dict
[
'cert_file'
]
=
conf
.
cert_file
connection_dict
[
'cert_file'
]
=
conf
.
cert_file
if
conf
.
slapgrid_jio_uri
:
connection_dict
[
"slapgrid_jio_uri"
]
=
conf
.
slapgrid_jio_uri
slap_instance
.
initializeConnection
(
conf
.
master_url
,
slap_instance
.
initializeConnection
(
conf
.
master_url
,
**
connection_dict
)
**
connection_dict
)
...
@@ -1745,7 +1743,6 @@ class FormatConfig(object):
...
@@ -1745,7 +1743,6 @@ class FormatConfig(object):
dry_run
=
None
# modifiable by cmdline
dry_run
=
None
# modifiable by cmdline
key_file
=
None
key_file
=
None
cert_file
=
None
cert_file
=
None
slapgrid_jio_uri
=
None
def
__init__
(
self
,
logger
):
def
__init__
(
self
,
logger
):
self
.
logger
=
logger
self
.
logger
=
logger
...
...
slapos/grid/SlapObject.py
View file @
837eb523
...
@@ -456,8 +456,6 @@ class Partition(object):
...
@@ -456,8 +456,6 @@ class Partition(object):
ipv4_global_network
=
''
,
ipv4_global_network
=
''
,
buildout_debug
=
False
,
buildout_debug
=
False
,
partition_timeout
=
None
,
partition_timeout
=
None
,
api_backward_compatibility
=
False
,
slapgrid_jio_uri
=
None
):
):
"""Initialisation of class parameters"""
"""Initialisation of class parameters"""
self
.
buildout
=
buildout
self
.
buildout
=
buildout
...
@@ -480,8 +478,6 @@ class Partition(object):
...
@@ -480,8 +478,6 @@ class Partition(object):
self
.
instance_storage_home
=
instance_storage_home
self
.
instance_storage_home
=
instance_storage_home
self
.
ipv4_global_network
=
ipv4_global_network
self
.
ipv4_global_network
=
ipv4_global_network
self
.
partition_timeout
=
partition_timeout
self
.
partition_timeout
=
partition_timeout
self
.
api_backward_compatibility
=
api_backward_compatibility
self
.
slapgrid_jio_uri
=
slapgrid_jio_uri
self
.
key_file
=
''
self
.
key_file
=
''
self
.
cert_file
=
''
self
.
cert_file
=
''
...
@@ -654,7 +650,6 @@ class Partition(object):
...
@@ -654,7 +650,6 @@ class Partition(object):
'software_instance_reference'
:
self
.
computer_partition
.
get
(
"reference"
),
'software_instance_reference'
:
self
.
computer_partition
.
get
(
"reference"
),
'server_url'
:
self
.
server_url
,
'server_url'
:
self
.
server_url
,
'software_release_url'
:
self
.
software_release_url
,
'software_release_url'
:
self
.
software_release_url
,
'slapgrid_jio_uri'
:
self
.
slapgrid_jio_uri
,
'key_file'
:
self
.
key_file
,
'key_file'
:
self
.
key_file
,
'cert_file'
:
self
.
cert_file
,
'cert_file'
:
self
.
cert_file
,
'storage_home'
:
self
.
instance_storage_home
,
'storage_home'
:
self
.
instance_storage_home
,
...
...
slapos/grid/slapgrid.py
View file @
837eb523
...
@@ -320,8 +320,7 @@ def create_slapgrid_object(options, logger):
...
@@ -320,8 +320,7 @@ def create_slapgrid_object(options, logger):
firewall_conf
=
op
.
get
(
'firewall'
),
firewall_conf
=
op
.
get
(
'firewall'
),
config
=
options
,
config
=
options
,
force_stop
=
op
.
get
(
'force_stop'
,
False
),
force_stop
=
op
.
get
(
'force_stop'
,
False
),
partition_timeout
=
partition_timeout
,
partition_timeout
=
partition_timeout
)
slapgrid_jio_uri
=
op
.
get
(
'slapgrid_jio_uri'
,
None
))
def
check_required_only_partitions
(
existing
,
required
):
def
check_required_only_partitions
(
existing
,
required
):
"""
"""
...
@@ -384,7 +383,6 @@ class Slapgrid(object):
...
@@ -384,7 +383,6 @@ class Slapgrid(object):
shared_part_list
=
''
,
shared_part_list
=
''
,
force_stop
=
False
,
force_stop
=
False
,
partition_timeout
=
None
,
partition_timeout
=
None
,
slapgrid_jio_uri
=
None
,
):
):
"""Makes easy initialisation of class parameters"""
"""Makes easy initialisation of class parameters"""
# Parses arguments
# Parses arguments
...
@@ -419,16 +417,10 @@ class Slapgrid(object):
...
@@ -419,16 +417,10 @@ class Slapgrid(object):
self
.
shadir_key_file
=
shadir_key_file
self
.
shadir_key_file
=
shadir_key_file
self
.
forbid_supervisord_automatic_launch
=
forbid_supervisord_automatic_launch
self
.
forbid_supervisord_automatic_launch
=
forbid_supervisord_automatic_launch
self
.
logger
=
logger
self
.
logger
=
logger
self
.
slapgrid_jio_uri
=
slapgrid_jio_uri
# Creates objects from slap module
# Creates objects from slap module
self
.
slap
=
slapos
.
slap
.
slap
()
self
.
slap
=
slapos
.
slap
.
slap
()
self
.
slap
.
initializeConnection
(
self
.
master_url
,
key_file
=
self
.
key_file
,
self
.
slap
.
initializeConnection
(
self
.
master_url
,
key_file
=
self
.
key_file
,
cert_file
=
self
.
cert_file
,
master_ca_file
=
self
.
master_ca_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
)
self
.
computer
=
self
.
slap
.
registerComputer
(
self
.
computer_id
)
# Defines all needed paths
# Defines all needed paths
self
.
buildout
=
buildout
self
.
buildout
=
buildout
...
@@ -1252,7 +1244,6 @@ stderr_logfile_backups=1
...
@@ -1252,7 +1244,6 @@ stderr_logfile_backups=1
computer_id
=
self
.
computer_id
,
computer_id
=
self
.
computer_id
,
partition_id
=
computer_partition_id
,
partition_id
=
computer_partition_id
,
server_url
=
self
.
master_url
,
server_url
=
self
.
master_url
,
slapgrid_jio_uri
=
self
.
slapgrid_jio_uri
,
software_release_url
=
software_url
,
software_release_url
=
software_url
,
certificate_repository_path
=
self
.
certificate_repository_path
,
certificate_repository_path
=
self
.
certificate_repository_path
,
buildout
=
self
.
buildout
,
buildout
=
self
.
buildout
,
...
@@ -1262,7 +1253,6 @@ stderr_logfile_backups=1
...
@@ -1262,7 +1253,6 @@ stderr_logfile_backups=1
instance_min_free_space
=
self
.
instance_min_free_space
,
instance_min_free_space
=
self
.
instance_min_free_space
,
instance_storage_home
=
self
.
instance_storage_home
,
instance_storage_home
=
self
.
instance_storage_home
,
ipv4_global_network
=
self
.
ipv4_global_network
,
ipv4_global_network
=
self
.
ipv4_global_network
,
api_backward_compatibility
=
self
.
api_backward_compatibility
,
)
)
self
.
logger
.
info
(
'Processing Promises for Computer Partition %s.'
,
computer_partition_id
)
self
.
logger
.
info
(
'Processing Promises for Computer Partition %s.'
,
computer_partition_id
)
...
@@ -1340,7 +1330,6 @@ stderr_logfile_backups=1
...
@@ -1340,7 +1330,6 @@ stderr_logfile_backups=1
computer_id
=
self
.
computer_id
,
computer_id
=
self
.
computer_id
,
partition_id
=
computer_partition_id
,
partition_id
=
computer_partition_id
,
server_url
=
self
.
master_url
,
server_url
=
self
.
master_url
,
slapgrid_jio_uri
=
self
.
slapgrid_jio_uri
,
software_release_url
=
software_url
,
software_release_url
=
software_url
,
certificate_repository_path
=
self
.
certificate_repository_path
,
certificate_repository_path
=
self
.
certificate_repository_path
,
buildout
=
self
.
buildout
,
buildout
=
self
.
buildout
,
...
@@ -1351,7 +1340,6 @@ stderr_logfile_backups=1
...
@@ -1351,7 +1340,6 @@ stderr_logfile_backups=1
instance_storage_home
=
self
.
instance_storage_home
,
instance_storage_home
=
self
.
instance_storage_home
,
ipv4_global_network
=
self
.
ipv4_global_network
,
ipv4_global_network
=
self
.
ipv4_global_network
,
partition_timeout
=
self
.
partition_timeout
,
partition_timeout
=
self
.
partition_timeout
,
api_backward_compatibility
=
self
.
api_backward_compatibility
)
)
# let managers modify current partition
# let managers modify current partition
...
@@ -1423,7 +1411,6 @@ stderr_logfile_backups=1
...
@@ -1423,7 +1411,6 @@ stderr_logfile_backups=1
self
.
logger
.
info
(
' Software URL: %s'
%
software_url
)
self
.
logger
.
info
(
' Software URL: %s'
%
software_url
)
self
.
logger
.
info
(
' Software path: %s'
%
software_path
)
self
.
logger
.
info
(
' Software path: %s'
%
software_path
)
self
.
logger
.
info
(
' Instance path: %s'
%
instance_path
)
self
.
logger
.
info
(
' Instance path: %s'
%
instance_path
)
self
.
logger
.
info
(
' jIO API used: %s'
%
(
not
self
.
api_backward_compatibility
))
# Update certifcate at late as possible
# Update certifcate at late as possible
local_partition
.
_updateCertificate
(
self
.
retrieveCertificates
(
computer_partition
))
local_partition
.
_updateCertificate
(
self
.
retrieveCertificates
(
computer_partition
))
...
@@ -2093,7 +2080,6 @@ stderr_logfile_backups=1
...
@@ -2093,7 +2080,6 @@ stderr_logfile_backups=1
computer_id
=
self
.
computer_id
,
computer_id
=
self
.
computer_id
,
partition_id
=
computer_partition_id
,
partition_id
=
computer_partition_id
,
server_url
=
self
.
master_url
,
server_url
=
self
.
master_url
,
slapgrid_jio_uri
=
self
.
slapgrid_jio_uri
,
software_release_url
=
software_url
,
software_release_url
=
software_url
,
certificate_repository_path
=
self
.
certificate_repository_path
,
certificate_repository_path
=
self
.
certificate_repository_path
,
buildout
=
self
.
buildout
,
buildout
=
self
.
buildout
,
...
...
slapos/grid/templates/buildout-tail.cfg.in
View file @
837eb523
...
@@ -10,7 +10,6 @@ offline = true
...
@@ -10,7 +10,6 @@ offline = true
computer-id = %(computer_id)s
computer-id = %(computer_id)s
partition-id = %(partition_id)s
partition-id = %(partition_id)s
server-url = %(server_url)s
server-url = %(server_url)s
slapgrid-jio-uri = %(slapgrid_jio_uri)s
software-release-url = %(software_release_url)s
software-release-url = %(software_release_url)s
key-file = %(key_file)s
key-file = %(key_file)s
cert-file = %(cert_file)s
cert-file = %(cert_file)s
...
...
slapos/slap/slap.py
View file @
837eb523
...
@@ -834,8 +834,7 @@ class slap:
...
@@ -834,8 +834,7 @@ class slap:
key_file
=
None
,
cert_file
=
None
,
key_file
=
None
,
cert_file
=
None
,
master_ca_file
=
None
,
master_ca_file
=
None
,
timeout
=
60
,
timeout
=
60
,
slapgrid_rest_uri
=
None
,
slapgrid_rest_uri
=
None
):
slapgrid_jio_uri
=
None
):
if
master_ca_file
:
if
master_ca_file
:
raise
NotImplementedError
(
'Master certificate not verified in this version: %s'
%
master_ca_file
)
raise
NotImplementedError
(
'Master certificate not verified in this version: %s'
%
master_ca_file
)
self
.
_connection_helper
=
SlapConnectionHelper
(
self
.
_connection_helper
=
SlapConnectionHelper
(
...
@@ -862,27 +861,6 @@ class slap:
...
@@ -862,27 +861,6 @@ class slap:
else
:
else
:
self
.
_hateoas_navigator
=
None
self
.
_hateoas_navigator
=
None
if
not
slapgrid_jio_uri
:
getjIOAPI_cache_key
=
(
slapgrid_uri
,
key_file
,
cert_file
,
master_ca_file
,
timeout
)
try
:
slapgrid_jio_uri
=
getjIOAPI_cache
[
getjIOAPI_cache_key
]
except
KeyError
:
pass
if
not
slapgrid_jio_uri
:
try
:
slapgrid_jio_uri
=
getjIOAPI_cache
[
getjIOAPI_cache_key
]
=
\
bytes2str
(
self
.
_connection_helper
.
GET
(
'getJIOAPIUrl'
))
except
:
pass
if
slapgrid_jio_uri
:
self
.
jio_api_connector
=
JioAPIConnectionHelper
(
slapgrid_jio_uri
,
key_file
,
cert_file
,
master_ca_file
,
timeout
)
else
:
self
.
jio_api_connector
=
None
# XXX-Cedric: this method is never used and thus should be removed.
# XXX-Cedric: this method is never used and thus should be removed.
def
registerSoftwareRelease
(
self
,
software_release
):
def
registerSoftwareRelease
(
self
,
software_release
):
"""
"""
...
...
slapos/tests/test_slapformat.py
View file @
837eb523
...
@@ -690,7 +690,6 @@ class TestFormatDump(SlapformatMixin):
...
@@ -690,7 +690,6 @@ class TestFormatDump(SlapformatMixin):
class
TestConfForAPI
():
class
TestConfForAPI
():
def
__init__
(
self
):
def
__init__
(
self
):
self
.
master_url
=
"https://127.0.0.1"
self
.
master_url
=
"https://127.0.0.1"
self
.
slapgrid_jio_uri
=
"https://127.0.0.1/api/"
self
.
key_file
=
None
self
.
key_file
=
None
self
.
cert_file
=
None
self
.
cert_file
=
None
self
.
dry_run
=
False
self
.
dry_run
=
False
...
...
slapos/tests/test_slapgrid.py
View file @
837eb523
...
@@ -195,7 +195,6 @@ class BasicMixin(object):
...
@@ -195,7 +195,6 @@ class BasicMixin(object):
shared_part_list
=
self
.
shared_parts_root
,
shared_part_list
=
self
.
shared_parts_root
,
force_stop
=
force_stop
,
force_stop
=
force_stop
,
certificate_repository_path
=
self
.
certificate_repository_path
,
certificate_repository_path
=
self
.
certificate_repository_path
,
slapgrid_jio_uri
=
self
.
master_url
+
"api/"
,
)
)
self
.
use_jio_api
=
True
self
.
use_jio_api
=
True
self
.
grid
.
_manager_list
=
self
.
manager_list
self
.
grid
.
_manager_list
=
self
.
manager_list
...
...
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