Allow to globally set no_containers

Previously no_containers could be set only for specified host group.
This patch adds option to define no_containers inside global_overrides
to set fully bare_metal deployment across all host groups.

Change-Id: I375ce28cdb7489af631d4ad41dc1ecaa78bd6d49
This commit is contained in:
Dmitriy Rabotyagov 2019-08-30 17:09:27 +03:00
parent 587ccf7c64
commit 21101aaa4d

View File

@ -355,7 +355,11 @@ def _add_container_hosts(assignment, config, container_name, container_type,
# Get any set host options
host_options = config[physical_host_type][host_type]
affinity = host_options.get('affinity', {})
no_containers = host_options.get('no_containers', False)
# Try to get no_containers from host_options and
# fallback to global_overrides if nothing found
no_containers = host_options.get(
'no_containers',
config['global_overrides'].get('no_containers', False))
if no_containers:
properties['is_metal'] = True