Commit 79d58689 authored by Antoine Catton's avatar Antoine Catton

TO REVERT: Pass the name of the slapos bridge to the buildout

parent 4c0de183
...@@ -269,7 +269,8 @@ class Partition(object): ...@@ -269,7 +269,8 @@ class Partition(object):
gid = stat_info.st_gid gid = stat_info.st_gid
return (uid, gid) return (uid, gid)
def install(self): # XXX : Remove bridge_name argument as soon as possible :
def install(self, bridge_name=None):
""" Creates configuration file from template in software_path, then """ Creates configuration file from template in software_path, then
installs the software partition with the help of buildout installs the software partition with the help of buildout
""" """
...@@ -309,7 +310,9 @@ class Partition(object): ...@@ -309,7 +310,9 @@ class Partition(object):
server_url=self.server_url, server_url=self.server_url,
software_release_url=self.software_release_url, software_release_url=self.software_release_url,
key_file=self.key_file, key_file=self.key_file,
cert_file=self.cert_file cert_file=self.cert_file,
# XXX : Remove the line below as soon as possible # XXX
bridge_name=bridge_name, # XXX
) )
open(config_location, 'w').write(buildout_text) open(config_location, 'w').write(buildout_text)
os.chmod(config_location, 0640) os.chmod(config_location, 0640)
......
...@@ -139,6 +139,11 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple): ...@@ -139,6 +139,11 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple):
slapgrid_configuration.readfp(configuration_file) slapgrid_configuration.readfp(configuration_file)
# Merges the two dictionnaries # Merges the two dictionnaries
option_dict = dict(slapgrid_configuration.items("slapos")) option_dict = dict(slapgrid_configuration.items("slapos"))
# XXX : Remove the lines below as soon as possible # XXX
option_dict.update(bridge_name=slapgrid_configuration.get('slapformat', # XXX
'interface_name')) # XXX
if slapgrid_configuration.has_section("networkcache"): if slapgrid_configuration.has_section("networkcache"):
option_dict.update(dict(slapgrid_configuration.items("networkcache"))) option_dict.update(dict(slapgrid_configuration.items("networkcache")))
for argument_key, argument_value in vars(argument_option_instance for argument_key, argument_value in vars(argument_option_instance
...@@ -266,7 +271,9 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple): ...@@ -266,7 +271,9 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple):
shacache_key_file=option_dict.get('shacache-key-file', None), shacache_key_file=option_dict.get('shacache-key-file', None),
shadir_cert_file=option_dict.get('shadir-cert-file', None), shadir_cert_file=option_dict.get('shadir-cert-file', None),
shadir_key_file=option_dict.get('shadir-key-file', None), shadir_key_file=option_dict.get('shadir-key-file', None),
develop=option_dict.get('develop', False) develop=option_dict.get('develop', False),
# XXX: Remove the line below as soon as possible # XXX
bridge_name=option_dict.get('bridge_name', None), # XXX
), ),
option_dict]) option_dict])
...@@ -354,7 +361,8 @@ class Slapgrid(object): ...@@ -354,7 +361,8 @@ class Slapgrid(object):
shacache_key_file=None, shacache_key_file=None,
shadir_cert_file=None, shadir_cert_file=None,
shadir_key_file=None, shadir_key_file=None,
develop=False): develop=False,
bridge_name=None):
"""Makes easy initialisation of class parameters""" """Makes easy initialisation of class parameters"""
# Parses arguments # Parses arguments
self.software_root = os.path.abspath(software_root) self.software_root = os.path.abspath(software_root)
...@@ -395,6 +403,8 @@ class Slapgrid(object): ...@@ -395,6 +403,8 @@ class Slapgrid(object):
self.buildout = buildout self.buildout = buildout
self.promise_timeout = promise_timeout self.promise_timeout = promise_timeout
self.develop = develop self.develop = develop
# XXX: Remove the line below as soon as possible # XXX
self.bridge_name = bridge_name # XXX
def checkEnvironmentAndCreateStructure(self): def checkEnvironmentAndCreateStructure(self):
"""Checks for software_root and instance_root existence, then creates """Checks for software_root and instance_root existence, then creates
...@@ -616,13 +626,19 @@ class Slapgrid(object): ...@@ -616,13 +626,19 @@ class Slapgrid(object):
try: try:
computer_partition_state = computer_partition.getState() computer_partition_state = computer_partition.getState()
if computer_partition_state == "started": if computer_partition_state == "started":
local_partition.install() # XXX : Before
# local_partition.install()
# XXX : Rollback the line bellow asap
local_partition.install(bridge_name=self.bridge_name)
computer_partition.available() computer_partition.available()
local_partition.start() local_partition.start()
self._checkPromises(computer_partition) self._checkPromises(computer_partition)
computer_partition.started() computer_partition.started()
elif computer_partition_state == "stopped": elif computer_partition_state == "stopped":
local_partition.install() # XXX : Before
# local_partition.install()
# XXX : Rollback the line bellow asap
local_partition.install(bridge_name=self.bridge_name)
computer_partition.available() computer_partition.available()
local_partition.stop() local_partition.stop()
computer_partition.stopped() computer_partition.stopped()
......
...@@ -13,4 +13,5 @@ server_url = %(server_url)s ...@@ -13,4 +13,5 @@ server_url = %(server_url)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
bridge_name = %(bridge_name)s
# This is end of zc.builodout profile's tail added by slapgrid # This is end of zc.builodout profile's tail added by slapgrid
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