From b3c610b205f88dddb02cdac39638c52eafaaf82c Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Tue, 12 Sep 2017 17:32:56 -0400 Subject: 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 --- apex/network/network_environment.py | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'apex/network/network_environment.py') 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 -- cgit 1.2.3-korg