summaryrefslogtreecommitdiffstats
path: root/lib/python
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2016-06-09 20:17:27 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-06-09 20:17:27 +0000
commitb9947ec813fea9c71b7c3208df36d110eca90b55 (patch)
tree1ded01be42104cd5ac33d04080fd6c157fe1150d /lib/python
parent41584070516695ecdc412b25d1f90866cd78e30f (diff)
parent7726620121424d8f0959587d0a1baf1768e57c63 (diff)
Merge "Add API network support"
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/apex/network_environment.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/python/apex/network_environment.py b/lib/python/apex/network_environment.py
index 03ecf06a..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:
@@ -118,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):