Browse Source

Add an internal index to network_data

When using the multiple nic-config templates in THT
and in tripleo-ansible the ordering of networks in
the network_data file matters.

Add and 'idx' key internally so that we can put a tag
on neutron network resources to keep track of the
ordering.

NOTE: Now also rename unused 'net' variable to '_'.

Change-Id: I6162ee854b08668274df32120e3ffc961b6cf807
Partial-Implements: blueprint network-data-v2-ports
(cherry picked from commit ff52ddb391)
changes/97/792197/2
Harald Jensås 5 months ago
parent
commit
83e63e4458
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      tripleo_common/utils/template.py

+ 4
- 0
tripleo_common/utils/template.py View File

@ -154,6 +154,10 @@ def process_custom_roles(swift, heat,
# Allow no networks defined in network_data
if network_data is None:
network_data = []
# Set internal network index key for each network, network resources
# are created with a tag tripleo_net_idx
for idx, _ in enumerate(network_data):
network_data[idx].update({'idx': idx})
except swiftexceptions.ClientException:
# Until t-h-t contains network_data.yaml we tolerate a missing file
LOG.warning("No %s file found, ignoring"


Loading…
Cancel
Save