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
This commit is contained in:
Dan Sneddon 2018-01-31 14:45:00 -08:00
parent aa44e05495
commit bc65df3c32

View File

@ -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],