Commit 837eb523 authored by Romain Courteaud's avatar Romain Courteaud

WIPWIP start dropping jio_api_connector

parent 45ebdd88
......@@ -364,8 +364,6 @@ class Computer(object):
if conf.key_file and conf.cert_file:
connection_dict['key_file'] = conf.key_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,
**connection_dict)
......@@ -1745,7 +1743,6 @@ class FormatConfig(object):
dry_run = None # modifiable by cmdline
key_file = None
cert_file = None
slapgrid_jio_uri = None
def __init__(self, logger):
self.logger = logger
......
......@@ -456,8 +456,6 @@ class Partition(object):
ipv4_global_network='',
buildout_debug=False,
partition_timeout=None,
api_backward_compatibility=False,
slapgrid_jio_uri=None
):
"""Initialisation of class parameters"""
self.buildout = buildout
......@@ -480,8 +478,6 @@ class Partition(object):
self.instance_storage_home = instance_storage_home
self.ipv4_global_network = ipv4_global_network
self.partition_timeout = partition_timeout
self.api_backward_compatibility = api_backward_compatibility
self.slapgrid_jio_uri = slapgrid_jio_uri
self.key_file = ''
self.cert_file = ''
......@@ -654,7 +650,6 @@ class Partition(object):
'software_instance_reference': self.computer_partition.get("reference"),
'server_url': self.server_url,
'software_release_url': self.software_release_url,
'slapgrid_jio_uri': self.slapgrid_jio_uri,
'key_file': self.key_file,
'cert_file': self.cert_file,
'storage_home': self.instance_storage_home,
......
......@@ -320,8 +320,7 @@ def create_slapgrid_object(options, logger):
firewall_conf=op.get('firewall'),
config=options,
force_stop=op.get('force_stop', False),
partition_timeout=partition_timeout,
slapgrid_jio_uri=op.get('slapgrid_jio_uri', None))
partition_timeout=partition_timeout)
def check_required_only_partitions(existing, required):
"""
......@@ -384,7 +383,6 @@ class Slapgrid(object):
shared_part_list='',
force_stop=False,
partition_timeout=None,
slapgrid_jio_uri=None,
):
"""Makes easy initialisation of class parameters"""
# Parses arguments
......@@ -419,16 +417,10 @@ class Slapgrid(object):
self.shadir_key_file = shadir_key_file
self.forbid_supervisord_automatic_launch = forbid_supervisord_automatic_launch
self.logger = logger
self.slapgrid_jio_uri = slapgrid_jio_uri
# Creates objects from slap module
self.slap = slapos.slap.slap()
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
cert_file=self.cert_file, master_ca_file=self.master_ca_file)
self.computer = self.slap.registerComputer(self.computer_id)
# Defines all needed paths
self.buildout = buildout
......@@ -1252,7 +1244,6 @@ stderr_logfile_backups=1
computer_id=self.computer_id,
partition_id=computer_partition_id,
server_url=self.master_url,
slapgrid_jio_uri=self.slapgrid_jio_uri,
software_release_url=software_url,
certificate_repository_path=self.certificate_repository_path,
buildout=self.buildout,
......@@ -1262,7 +1253,6 @@ stderr_logfile_backups=1
instance_min_free_space=self.instance_min_free_space,
instance_storage_home=self.instance_storage_home,
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)
......@@ -1340,7 +1330,6 @@ stderr_logfile_backups=1
computer_id=self.computer_id,
partition_id=computer_partition_id,
server_url=self.master_url,
slapgrid_jio_uri=self.slapgrid_jio_uri,
software_release_url=software_url,
certificate_repository_path=self.certificate_repository_path,
buildout=self.buildout,
......@@ -1351,7 +1340,6 @@ stderr_logfile_backups=1
instance_storage_home=self.instance_storage_home,
ipv4_global_network=self.ipv4_global_network,
partition_timeout=self.partition_timeout,
api_backward_compatibility=self.api_backward_compatibility
)
# let managers modify current partition
......@@ -1423,7 +1411,6 @@ stderr_logfile_backups=1
self.logger.info(' Software URL: %s' % software_url)
self.logger.info(' Software path: %s' % software_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
local_partition._updateCertificate(self.retrieveCertificates(computer_partition))
......@@ -2093,7 +2080,6 @@ stderr_logfile_backups=1
computer_id=self.computer_id,
partition_id=computer_partition_id,
server_url=self.master_url,
slapgrid_jio_uri=self.slapgrid_jio_uri,
software_release_url=software_url,
certificate_repository_path=self.certificate_repository_path,
buildout=self.buildout,
......
......@@ -10,7 +10,6 @@ offline = true
computer-id = %(computer_id)s
partition-id = %(partition_id)s
server-url = %(server_url)s
slapgrid-jio-uri = %(slapgrid_jio_uri)s
software-release-url = %(software_release_url)s
key-file = %(key_file)s
cert-file = %(cert_file)s
......
......@@ -834,8 +834,7 @@ class slap:
key_file=None, cert_file=None,
master_ca_file=None,
timeout=60,
slapgrid_rest_uri=None,
slapgrid_jio_uri=None):
slapgrid_rest_uri=None):
if master_ca_file:
raise NotImplementedError('Master certificate not verified in this version: %s' % master_ca_file)
self._connection_helper = SlapConnectionHelper(
......@@ -862,27 +861,6 @@ class slap:
else:
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.
def registerSoftwareRelease(self, software_release):
"""
......
......@@ -690,7 +690,6 @@ class TestFormatDump(SlapformatMixin):
class TestConfForAPI():
def __init__(self):
self.master_url = "https://127.0.0.1"
self.slapgrid_jio_uri = "https://127.0.0.1/api/"
self.key_file = None
self.cert_file = None
self.dry_run = False
......
......@@ -195,7 +195,6 @@ class BasicMixin(object):
shared_part_list=self.shared_parts_root,
force_stop=force_stop,
certificate_repository_path=self.certificate_repository_path,
slapgrid_jio_uri=self.master_url + "api/",
)
self.use_jio_api = True
self.grid._manager_list = self.manager_list
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment