summaryrefslogtreecommitdiffstats
path: root/lib/python
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/apex/deploy_env.py26
-rw-r--r--lib/python/apex/network_environment.py26
2 files changed, 45 insertions, 7 deletions
diff --git a/lib/python/apex/deploy_env.py b/lib/python/apex/deploy_env.py
index bfb94f50..fb03cd07 100644
--- a/lib/python/apex/deploy_env.py
+++ b/lib/python/apex/deploy_env.py
@@ -12,9 +12,11 @@ import yaml
import logging
REQ_DEPLOY_SETTINGS = ['sdn_controller',
+ 'odl_version',
'sdn_l3',
'tacker',
'congress',
+ 'dataplane',
'sfc',
'vpn']
@@ -22,6 +24,7 @@ OPT_DEPLOY_SETTINGS = ['performance']
VALID_ROLES = ['Controller', 'Compute', 'ObjectStorage']
VALID_PERF_OPTS = ['kernel','nova']
+VALID_DATAPLANES = ['ovs','ovs_dpdk','fdio']
class DeploySettings:
"""
@@ -54,14 +57,23 @@ class DeploySettings:
if not isinstance(deploy_options, dict):
raise DeploySettingsException("deploy_options should be a list")
- for option in deploy_options:
- if option not in REQ_DEPLOY_SETTINGS + OPT_DEPLOY_SETTINGS:
+ for setting, value in deploy_options.items():
+ if setting not in REQ_DEPLOY_SETTINGS + OPT_DEPLOY_SETTINGS:
raise DeploySettingsException("Invalid deploy_option {} "
- "specified".format(option))
-
- for required_setting in REQ_DEPLOY_SETTINGS:
- if required_setting not in deploy_options:
- self.deploy_settings['deploy_options']['required'] = False
+ "specified".format(setting))
+ if setting == 'dataplane':
+ if value not in VALID_DATAPLANES:
+ planes = ' '.join(VALID_DATAPLANES)
+ raise DeploySettingsException("Invalid dataplane {} "
+ "specified. Valid dataplanes:"
+ " {}".format(value,planes))
+
+ for req_set in REQ_DEPLOY_SETTINGS:
+ if req_set not in deploy_options:
+ if req_set == 'dataplane':
+ self.deploy_settings['deploy_options'][req_set] = 'ovs'
+ else:
+ self.deploy_settings['deploy_options'][req_set] = False
if 'performance' in deploy_options:
if not isinstance(deploy_options['performance'], dict):
diff --git a/lib/python/apex/network_environment.py b/lib/python/apex/network_environment.py
index e6f0135a..c9b7d3cc 100644
--- a/lib/python/apex/network_environment.py
+++ b/lib/python/apex/network_environment.py
@@ -20,6 +20,10 @@ STORAGE_RESOURCES = {'OS::TripleO::Network::Storage': None,
'OS::TripleO::Network::Ports::StorageVipPort': PORTS,
'OS::TripleO::Controller::Ports::StoragePort': PORTS,
'OS::TripleO::Compute::Ports::StoragePort': PORTS}
+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}
class NetworkEnvironment:
@@ -78,6 +82,7 @@ class NetworkEnvironment:
net_settings[constants.PUBLIC_NETWORK]['gateway']
self.netenv_obj[param_def]['EC2MetadataIp'] = \
net_settings[constants.ADMIN_NETWORK]['provisioner_ip']
+ self.netenv_obj[param_def]['DnsServers'] = net_settings['dns_servers']
if constants.PRIVATE_NETWORK in enabled_networks:
priv_range = net_settings[constants.PRIVATE_NETWORK][
@@ -117,6 +122,27 @@ class NetworkEnvironment:
if prefix is None:
prefix = ''
self.netenv_obj[reg][key] = tht_dir + prefix + postfix
+
+ if constants.API_NETWORK in enabled_networks:
+ api_range = net_settings[constants.API_NETWORK][
+ 'usable_ip_range'].split(',')
+ self.netenv_obj[param_def]['InternalApiAllocationPools'] = \
+ [{'start':
+ api_range[0],
+ 'end':
+ api_range[1]
+ }]
+ api_cidr = net_settings[constants.API_NETWORK]['cidr']
+ self.netenv_obj[param_def]['InternalApiNetCidr'] = str(api_cidr)
+ postfix = '/internal_api.yaml'
+ else:
+ postfix = '/noop.yaml'
+
+ for key, prefix in API_RESOURCES.items():
+ if prefix is None:
+ prefix = ''
+ self.netenv_obj[reg][key] = tht_dir + prefix + postfix
+
return self.netenv_obj
def get_netenv_settings(self):