diff options
author | Tim Rozet <trozet@redhat.com> | 2018-01-15 15:07:07 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-01-15 15:07:07 +0000 |
commit | f867d216c135c30d3c86a28bf52495639ff4e890 (patch) | |
tree | 6ea6a2607b14d518926108c89aedb1d437810ce8 /apex/overcloud/deploy.py | |
parent | b4697b5cd6c5c0432fcd12ca78785f425e5fcf5b (diff) | |
parent | 847f7673f8ba68583c85eee5c30d7657f82ad50f (diff) |
Merge "Fixes including default SDN env file in deploy cmd"
Diffstat (limited to 'apex/overcloud/deploy.py')
-rw-r--r-- | apex/overcloud/deploy.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/apex/overcloud/deploy.py b/apex/overcloud/deploy.py index 809afc13..5c957965 100644 --- a/apex/overcloud/deploy.py +++ b/apex/overcloud/deploy.py @@ -71,14 +71,37 @@ ODL_NETVIRT_VPP_RPM = "/root/opendaylight-7.0.0-0.1.20170531snap665.el7" \ def build_sdn_env_list(ds, sdn_map, env_list=None): + """ + Builds a list of SDN environment files to be used in the deploy cmd. + + This function recursively searches an sdn_map. First the sdn controller is + matched and then the function looks for enabled features for that + controller to determine which environment files should be used. By + default the feature will be checked if set to true in deploy settings to be + added to the list. If a feature does not have a boolean value, then the + key and value pair to compare with are checked as a tuple (k,v). + + :param ds: deploy settings + :param sdn_map: SDN map to recursively search + :param env_list: recursive var to hold previously found env_list + :return: A list of env files + """ if env_list is None: env_list = list() for k, v in sdn_map.items(): if ds['sdn_controller'] == k or (k in ds and ds[k] is True): if isinstance(v, dict): + # Append default SDN env file first + # The assumption is that feature-enabled SDN env files + # override and do not conflict with previously set default + # settings + if ds['sdn_controller'] == k and 'default' in v: + env_list.append(os.path.join(con.THT_ENV_DIR, + v['default'])) env_list.extend(build_sdn_env_list(ds, v)) else: env_list.append(os.path.join(con.THT_ENV_DIR, v)) + # check if the value is not a boolean elif isinstance(v, tuple): if ds[k] == v[0]: env_list.append(os.path.join(con.THT_ENV_DIR, v[1])) |