Allow network data with no entries

When deploying without network isolation we should
allow an empty network_data.yaml with no networks.

In combination with tripleo-heat-templates change:
Ifeb2d2d1acb43c16a5bf29e95965776494d61fef the
tripleoclient can be update to use /dev/null as
network data, and networks can be removed from
roles/Standalone.yaml and roles/Undercloud.yaml.

Related-Bug: #1809313
Change-Id: I2e8135bc9389d3bf1a6ef01e273515af5c488a9a
This commit is contained in:
Harald Jensås 2018-12-24 15:17:08 +01:00
parent 3a44e5bed2
commit 9590e84507
1 changed files with 3 additions and 0 deletions

View File

@ -188,6 +188,9 @@ class ProcessTemplatesAction(base.TripleOAction):
j2_network_file = swift.get_object(
self.container, constants.OVERCLOUD_J2_NETWORKS_NAME)[1]
network_data = yaml.safe_load(j2_network_file)
# Allow no networks defined in network_data
if network_data is None:
network_data = []
except swiftexceptions.ClientException:
# Until t-h-t contains network_data.yaml we tolerate a missing file
LOG.warning("No %s file found, ignoring"