From 21101aaa4d4e1ce501a15024d9cbf2d55b17d429 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Fri, 30 Aug 2019 17:09:27 +0300 Subject: [PATCH] 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 --- osa_toolkit/generate.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osa_toolkit/generate.py b/osa_toolkit/generate.py index ce42c39d8b..a567f94458 100755 --- a/osa_toolkit/generate.py +++ b/osa_toolkit/generate.py @@ -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