Commit 15c91309 authored by Alain Takoudjou's avatar Alain Takoudjou

slapgrid: define global-ipv4-network parameter useful when configuring cluster of VM

parent 41a62737
...@@ -344,7 +344,8 @@ class Partition(object): ...@@ -344,7 +344,8 @@ class Partition(object):
certificate_repository_path=None, certificate_repository_path=None,
retention_delay='0', retention_delay='0',
instance_min_free_space=None, instance_min_free_space=None,
instance_storage_home='' instance_storage_home='',
ipv4_global_network='',
): ):
"""Initialisation of class parameters""" """Initialisation of class parameters"""
self.buildout = buildout self.buildout = buildout
...@@ -362,6 +363,7 @@ class Partition(object): ...@@ -362,6 +363,7 @@ class Partition(object):
self.server_url = server_url self.server_url = server_url
self.software_release_url = software_release_url self.software_release_url = software_release_url
self.instance_storage_home = instance_storage_home self.instance_storage_home = instance_storage_home
self.ipv4_global_network = ipv4_global_network
self.key_file = '' self.key_file = ''
self.cert_file = '' self.cert_file = ''
...@@ -517,6 +519,7 @@ class Partition(object): ...@@ -517,6 +519,7 @@ class Partition(object):
'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,
'global_ipv4_network_prefix': self.ipv4_global_network,
} }
open(config_location, 'w').write(buildout_text) open(config_location, 'w').write(buildout_text)
os.chmod(config_location, 0o640) os.chmod(config_location, 0o640)
......
...@@ -233,7 +233,8 @@ def create_slapgrid_object(options, logger): ...@@ -233,7 +233,8 @@ def create_slapgrid_object(options, logger):
computer_partition_filter_list=op.get('only-cp', op.get('only_cp')), computer_partition_filter_list=op.get('only-cp', op.get('only_cp')),
software_min_free_space=software_min_free_space, software_min_free_space=software_min_free_space,
instance_min_free_space=instance_min_free_space, instance_min_free_space=instance_min_free_space,
instance_storage_home=op.get('instance_storage_home')) instance_storage_home=op.get('instance_storage_home'),
ipv4_global_network=op.get('ipv4_global_network'))
def check_required_only_partitions(existing, required): def check_required_only_partitions(existing, required):
...@@ -288,6 +289,7 @@ class Slapgrid(object): ...@@ -288,6 +289,7 @@ class Slapgrid(object):
software_min_free_space=None, software_min_free_space=None,
instance_min_free_space=None, instance_min_free_space=None,
instance_storage_home=None, instance_storage_home=None,
ipv4_global_network=None,
): ):
"""Makes easy initialisation of class parameters""" """Makes easy initialisation of class parameters"""
# Parses arguments # Parses arguments
...@@ -343,6 +345,10 @@ class Slapgrid(object): ...@@ -343,6 +345,10 @@ class Slapgrid(object):
self.instance_storage_home = os.path.abspath(instance_storage_home) self.instance_storage_home = os.path.abspath(instance_storage_home)
else: else:
self.instance_storage_home = "" self.instance_storage_home = ""
if ipv4_global_network:
self.ipv4_global_network = ipv4_global_network
else:
self.ipv4_global_network= ""
def _getWatchdogLine(self): def _getWatchdogLine(self):
invocation_list = [WATCHDOG_PATH] invocation_list = [WATCHDOG_PATH]
...@@ -651,6 +657,7 @@ class Slapgrid(object): ...@@ -651,6 +657,7 @@ class Slapgrid(object):
retention_delay=retention_delay, retention_delay=retention_delay,
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,
) )
computer_partition_state = computer_partition.getState() computer_partition_state = computer_partition.getState()
...@@ -1110,6 +1117,7 @@ class Slapgrid(object): ...@@ -1110,6 +1117,7 @@ class Slapgrid(object):
buildout=self.buildout, buildout=self.buildout,
logger=self.logger, logger=self.logger,
instance_storage_home=self.instance_storage_home, instance_storage_home=self.instance_storage_home,
ipv4_global_network=self.ipv4_global_network,
) )
local_partition.stop() local_partition.stop()
try: try:
......
...@@ -25,4 +25,7 @@ cert_file = %(cert_file)s ...@@ -25,4 +25,7 @@ cert_file = %(cert_file)s
[storage-configuration] [storage-configuration]
storage-home = %(storage_home)s storage-home = %(storage_home)s
[network-information]
global-ipv4-network = %(global_ipv4_network_prefix)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