diff options
author | Feng Pan <fpan@redhat.com> | 2017-10-16 13:17:49 -0400 |
---|---|---|
committer | Tim Rozet <trozet@redhat.com> | 2017-10-19 13:28:03 +0000 |
commit | 909f355dd5195e81b45a14f88f6f879ee4c8867d (patch) | |
tree | ac81eee192a9061b61b7715c7475a053d27b07e7 | |
parent | e675928d02d66928f291b83ef805b56a5fc41010 (diff) |
Fix interface role mapping config for odl-fdio scenarios
This patch fixes a bug in deploy config function that will make
performance parameters overwrite interface role mapping config for honeycomb.
apex-os-net-config: Ifa3b18aa6370c79ad6ad3ce983f1648ff0d1d79d
Change-Id: Icdb7603577bc7edf1959238ddd3d686c310544ce
Signed-off-by: Feng Pan <fpan@redhat.com>
(cherry picked from commit da99ee8cf99824a7ee5ff19544d3eec4788edd68)
-rw-r--r-- | apex/overcloud/deploy.py | 40 | ||||
-rw-r--r-- | apex/tests/test_apex_overcloud_deploy.py | 30 |
2 files changed, 48 insertions, 22 deletions
diff --git a/apex/overcloud/deploy.py b/apex/overcloud/deploy.py index ef916a43..8016e1fd 100644 --- a/apex/overcloud/deploy.py +++ b/apex/overcloud/deploy.py @@ -306,8 +306,12 @@ def prep_env(ds, ns, inv, opnfv_env, net_env, tmp_dir): tmp_opnfv_env = os.path.join(tmp_dir, os.path.basename(opnfv_env)) shutil.copyfile(opnfv_env, tmp_opnfv_env) tenant_nic_map = ns['networks']['tenant']['nic_mapping'] - tenant_ctrl_nic = tenant_nic_map['controller']['members'][0] - tenant_comp_nic = tenant_nic_map['compute']['members'][0] + tenant_nic = dict() + tenant_nic['Controller'] = tenant_nic_map['controller']['members'][0] + tenant_nic['NovaCompute'] = tenant_nic_map['compute']['members'][0] + external_nic_map = ns['networks']['external'][0]['nic_mapping'] + external_nic = dict() + external_nic['NovaCompute'] = external_nic_map['compute']['members'][0] # SSH keys private_key, public_key = make_ssh_key() @@ -361,22 +365,10 @@ def prep_env(ds, ns, inv, opnfv_env, net_env, tmp_dir): output_line = (" opendaylight::vpp_routing_node: {}.{}" .format(ds_opts['odl_vpp_routing_node'], ns['domain_name'])) - elif 'ControllerExtraConfig' in line: - output_line = (" ControllerExtraConfig:\n " - "tripleo::profile::base::neutron::agents::" - "honeycomb::interface_role_mapping:" - " ['{}:tenant-interface]'" - .format(tenant_ctrl_nic)) - elif 'NovaComputeExtraConfig' in line: - output_line = (" NovaComputeExtraConfig:\n " - "tripleo::profile::base::neutron::agents::" - "honeycomb::interface_role_mapping:" - " ['{}:tenant-interface]'" - .format(tenant_comp_nic)) elif not ds_opts['sdn_controller'] and ds_opts['dataplane'] == 'fdio': if 'NeutronVPPAgentPhysnets' in line: output_line = (" NeutronVPPAgentPhysnets: 'datacentre:{}'". - format(tenant_ctrl_nic)) + format(tenant_nic['Controller'])) elif ds_opts['sdn_controller'] == 'opendaylight' and ds_opts.get( 'dvr') is True: if 'OS::TripleO::Services::NeutronDhcpAgent' in line: @@ -405,6 +397,24 @@ def prep_env(ds, ns, inv, opnfv_env, net_env, tmp_dir): perf_line += ("\n " "fdio::vpp_cpu_corelist_workers: '{}'" .format(perf_opts['corelist-workers'])) + if ds_opts['sdn_controller'] == 'opendaylight' and \ + ds_opts['dataplane'] == 'fdio': + if role == 'NovaCompute': + perf_line += ("\n " + "tripleo::profile::base::neutron::" + "agents::honeycomb::" + "interface_role_mapping:" + " ['{}:tenant-interface'," + "'{}:public-interface']" + .format(tenant_nic[role], + external_nic[role])) + else: + perf_line += ("\n " + "tripleo::profile::base::neutron::" + "agents::honeycomb::" + "interface_role_mapping:" + " ['{}:tenant-interface']" + .format(tenant_nic[role])) if perf_line: output_line = (" {}:{}".format(cfg, perf_line)) diff --git a/apex/tests/test_apex_overcloud_deploy.py b/apex/tests/test_apex_overcloud_deploy.py index 1df10e4e..59e9048f 100644 --- a/apex/tests/test_apex_overcloud_deploy.py +++ b/apex/tests/test_apex_overcloud_deploy.py @@ -245,9 +245,14 @@ class TestOvercloudDeploy(unittest.TestCase): 'networks': {'tenant': {'nic_mapping': {'controller': - {'members': ['test']}, + {'members': ['tenant_nic']}, 'compute': - {'members': ['test']}}}}} + {'members': ['tenant_nic']}}}, + 'external': + [{'nic_mapping': {'controller': + {'members': ['ext_nic']}, + 'compute': + {'members': ['ext_nic']}}}]}} inv = None try: # Swap stdout @@ -279,9 +284,14 @@ class TestOvercloudDeploy(unittest.TestCase): 'networks': {'tenant': {'nic_mapping': {'controller': - {'members': ['test']}, + {'members': ['tenant_nic']}, 'compute': - {'members': ['test']}}}}} + {'members': ['tenant_nic']}}}, + 'external': + [{'nic_mapping': {'controller': + {'members': ['ext_nic']}, + 'compute': + {'members': ['ext_nic']}}}]}} inv = None try: # Swap stdout @@ -291,7 +301,8 @@ class TestOvercloudDeploy(unittest.TestCase): # run test prep_env(ds, ns, inv, 'opnfv-env.yml', '/net-env.yml', '/tmp') output = out.getvalue().strip() - assert_in('NeutronVPPAgentPhysnets: \'datacentre:test\'', output) + assert_in('NeutronVPPAgentPhysnets: \'datacentre:tenant_nic\'', + output) assert_in('NeutronVPPAgentPhysnets', output) finally: # put stdout back @@ -311,9 +322,14 @@ class TestOvercloudDeploy(unittest.TestCase): 'networks': {'tenant': {'nic_mapping': {'controller': - {'members': ['test']}, + {'members': ['tenant_nic']}, 'compute': - {'members': ['test']}}}}} + {'members': ['tenant_nic']}}}, + 'external': + [{'nic_mapping': {'controller': + {'members': ['ext_nic']}, + 'compute': + {'members': ['ext_nic']}}}]}} inv = MagicMock() inv.get_node_counts.return_value = (3, 2) try: |