diff options
author | Tim Rozet <trozet@redhat.com> | 2017-09-12 17:32:56 -0400 |
---|---|---|
committer | Tim Rozet <trozet@redhat.com> | 2017-11-06 04:35:02 +0000 |
commit | b3c610b205f88dddb02cdac39638c52eafaaf82c (patch) | |
tree | 4826027e2d968e61c8024d972f3665ff3a8a09d7 /apex/network/network_environment.py | |
parent | 3c7556eb0734706f28588fb952eedea2d424c6d2 (diff) |
Adds ability to deploy from upstream openstack
To deploy with upstream openstack branch, use new deploy setting 'os_version'.
A default scenario file for nosdn with pike has been included in this patch.
If 'os_version' is a version other than the default version for this OPNFV
release, then upstream is used.
In order to use upstream with the current OS version use '--upstream'
argument to the deploy command, to force an upstream deployment.
Also include '-e upstream-environment.yaml' to use default upstream
deployment settings.
Supports nosdn and odl-nofeature deployments.
Change-Id: Ic07e308827b449637b4e86cdd086434e4de2fb69
Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'apex/network/network_environment.py')
-rw-r--r-- | apex/network/network_environment.py | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/apex/network/network_environment.py b/apex/network/network_environment.py index c2e9991a..ea71e0f3 100644 --- a/apex/network/network_environment.py +++ b/apex/network/network_environment.py @@ -8,7 +8,6 @@ ############################################################################## import re - import yaml from apex.settings.network_settings import NetworkSettings @@ -19,7 +18,8 @@ from apex.common.constants import ( TENANT_NETWORK, STORAGE_NETWORK, EXTERNAL_NETWORK, - API_NETWORK + API_NETWORK, + DEFAULT_OS_VERSION, ) HEAT_NONE = 'OS::Heat::None' @@ -40,6 +40,12 @@ API_RESOURCES = {'OS::TripleO::Network::InternalApi': None, 'OS::TripleO::Network::Ports::InternalApiVipPort': PORTS, 'OS::TripleO::Controller::Ports::InternalApiPort': PORTS, 'OS::TripleO::Compute::Ports::InternalApiPort': PORTS} +STORAGE_MGMT_RESOURCES = { + 'OS::TripleO::Network::StorageMgmt': None, + 'OS::TripleO::Network::Ports::StorageMgmtVipPort': PORTS, + 'OS::TripleO::Controller::Ports::StorageMgmtPort': PORTS, + 'OS::TripleO::Compute::Ports::StorageMgmtPort': PORTS +} # A list of flags that will be set to true when IPv6 is enabled IPV6_FLAGS = ["NovaIPv6", "MongoDbIPv6", "CorosyncIPv6", "CephIPv6", @@ -58,23 +64,20 @@ class NetworkEnvironment(dict): based on a NetworkSettings object. """ def __init__(self, net_settings, filename, compute_pre_config=False, - controller_pre_config=False): + controller_pre_config=False, os_version=DEFAULT_OS_VERSION): """ Create Network Environment according to Network Settings """ init_dict = {} + if not isinstance(net_settings, NetworkSettings): + raise NetworkEnvException('Invalid Network Settings object') if isinstance(filename, str): with open(filename, 'r') as net_env_fh: init_dict = yaml.safe_load(net_env_fh) - super().__init__(init_dict) - if not isinstance(net_settings, NetworkSettings): - raise NetworkEnvException('Invalid Network Settings object') - self._set_tht_dir() - nets = net_settings['networks'] - + self.os_version = os_version admin_cidr = nets[ADMIN_NETWORK]['cidr'] admin_prefix = str(admin_cidr.prefixlen) self[param_def]['ControlPlaneSubnetCidr'] = admin_prefix @@ -173,6 +176,9 @@ class NetworkEnvironment(dict): # apply resource registry update for API_RESOURCES self._config_resource_reg(API_RESOURCES, postfix) + if self.os_version != 'ocata': + self._config_resource_reg(STORAGE_MGMT_RESOURCES, '/noop.yaml') + # Set IPv6 related flags to True. Not that we do not set those to False # when IPv4 is configured, we'll use the default or whatever the user # may have set. @@ -204,7 +210,10 @@ class NetworkEnvironment(dict): for key, prefix in resources.items(): if prefix is None: if postfix == '/noop.yaml': - self[reg][key] = HEAT_NONE + if self.os_version == 'ocata': + self[reg][key] = HEAT_NONE + else: + del self[reg][key] continue prefix = '' self[reg][key] = self.tht_dir + prefix + postfix |