Don't require provider_networks with no_containers

When no_containers is set in global_overrides it means that it's going
to be metal deployment. Since metal deployments do not require
provider_networks, we can easily skip check of their existance in
openstack_user_config.yml

Change-Id: Ie12d13f5eb90bc4fbb4bf73e2d5915b1493e819d
This commit is contained in:
Dmitriy Rabotyagov 2019-11-29 16:52:31 +02:00 committed by Dmitriy Rabotyagov (noonedeadpunk)
parent 85f66467cd
commit 94e477032a

View File

@ -993,12 +993,17 @@ def _check_config_settings(cidr_networks, config, container_skel):
# search for any container that doesn't have is_metal flag set to true
is_provider_networks_needed = False
for key, value in container_skel.items():
properties = value.get('properties', {})
is_metal = properties.get('is_metal', False)
if not is_metal:
is_provider_networks_needed = True
break
if 'global_overrides' in config:
no_containers = config['global_overrides'].get('no_containers', False)
else:
no_containers = False
if not no_containers:
for key, value in container_skel.items():
properties = value.get('properties', {})
is_metal = properties.get('is_metal', False)
if not is_metal:
is_provider_networks_needed = True
break
if is_provider_networks_needed:
if ('global_overrides' not in config):