From bc65df3c32ac770f84b8a93af64dc1f8b650f637 Mon Sep 17 00:00:00 2001 From: Dan Sneddon Date: Wed, 31 Jan 2018 14:45:00 -0800 Subject: [PATCH] Support deprecated NIC config names for legacy roles. This patch enables a fix for bug/1737041 while supporting upgrades from previous deployments where the NIC config template for the role does not match the composable role name ,e.g. cinder-storage for the BlockStorage role. This change looks for a property in network_data.yaml, deprecated_nic_config_name. Partial-Bug: 1737041 Change-Id: I49c0245c36de3103671080fd1c8cfb3432856f35 --- tripleo_common/actions/templates.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tripleo_common/actions/templates.py b/tripleo_common/actions/templates.py index 1a95a5a20..c3a29b69f 100644 --- a/tripleo_common/actions/templates.py +++ b/tripleo_common/actions/templates.py @@ -265,6 +265,13 @@ class ProcessTemplatesAction(base.TripleOAction): os.path.basename(f).replace('.role.j2.yaml', '.yaml')]) out_f_path = os.path.join(os.path.dirname(f), out_f) + if ('network/config' in os.path.dirname(f) and + r_map[role].get('deprecated_nic_config_name')): + d_name = r_map[role].get('deprecated_nic_config_name') + out_f_path = os.path.join(os.path.dirname(f), d_name) + elif ('network/config' in os.path.dirname(f)): + d_name = "%s.yaml" % role.lower() + out_f_path = os.path.join(os.path.dirname(f), d_name) if not (out_f_path in excl_templates): if '{{role.name}}' in j2_template: j2_data = {'role': r_map[role],