summaryrefslogtreecommitdiffstats
path: root/lib/python/apex
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2016-08-03 19:23:14 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-08-03 19:23:14 +0000
commit2912d5cf3ce7f160a33d0ba1fb681c5cbae33944 (patch)
treef8beda78de9053794a92e085c3df088f0db4dff2 /lib/python/apex
parent80783b3b94f3f1dba94bcb15d43be311e157120e (diff)
parent0cf5b3770e33ed1168e98d557a6dc212ca57f970 (diff)
Merge "Adds configuring vpp/hc on all nodes"
Diffstat (limited to 'lib/python/apex')
-rw-r--r--lib/python/apex/common/constants.py4
-rw-r--r--lib/python/apex/network_environment.py15
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/python/apex/common/constants.py b/lib/python/apex/common/constants.py
index 996ef2f0..ae8ffe31 100644
--- a/lib/python/apex/common/constants.py
+++ b/lib/python/apex/common/constants.py
@@ -17,3 +17,7 @@ OPNFV_NETWORK_TYPES = [ADMIN_NETWORK, PRIVATE_NETWORK, PUBLIC_NETWORK,
DNS_SERVERS = ["8.8.8.8", "8.8.4.4"]
ROLES = ['compute', 'controller']
DOMAIN_NAME = 'localdomain.com'
+COMPUTE_PRE = "OS::TripleO::ComputeExtraConfigPre"
+CONTROLLER_PRE = "OS::TripleO::ControllerExtraConfigPre"
+PRE_CONFIG_DIR = "/usr/share/openstack-tripleo-heat-templates/puppet/" \
+ "extraconfig/pre_deploy/"
diff --git a/lib/python/apex/network_environment.py b/lib/python/apex/network_environment.py
index 981c8f1c..bf81b98d 100644
--- a/lib/python/apex/network_environment.py
+++ b/lib/python/apex/network_environment.py
@@ -15,6 +15,9 @@ from .common.constants import (
STORAGE_NETWORK,
PUBLIC_NETWORK,
API_NETWORK,
+ CONTROLLER_PRE,
+ COMPUTE_PRE,
+ PRE_CONFIG_DIR
)
PORTS = '/ports'
@@ -48,8 +51,11 @@ class NetworkEnvironment:
The class builds upon an existing network-environment file and modifies
based on a NetworkSettings object.
"""
- def __init__(self, net_settings, filename):
+ def __init__(self, net_settings, filename, compute_pre_config=False,
+ controller_pre_config=False):
with open(filename, 'r') as net_env_fh:
+ self.compute_pre = compute_pre_config
+ self.controller_pre = controller_pre_config
self.netenv_obj = yaml.load(net_env_fh)
self._update_net_environment(net_settings)
@@ -185,6 +191,13 @@ class NetworkEnvironment:
prefix = ''
self.netenv_obj[reg][key] = tht_dir + prefix + postfix
+ if self.compute_pre:
+ self.netenv_obj[reg][COMPUTE_PRE] = PRE_CONFIG_DIR + \
+ "compute/numa.yaml"
+ if self.controller_pre:
+ self.netenv_obj[reg][CONTROLLER_PRE] = PRE_CONFIG_DIR + \
+ "controller/numa.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.