From 1e645f7a567178a0af444a08e87987eeaed557c5 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Tue, 28 Jun 2022 12:03:56 +0000 Subject: containers: T4473: Fix create container with not exist network Fix for setting container without or wrong network decalaration --- src/conf_mode/container.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/conf_mode/container.py b/src/conf_mode/container.py index 2110fd9e0..39fb94d93 100755 --- a/src/conf_mode/container.py +++ b/src/conf_mode/container.py @@ -132,7 +132,7 @@ def verify(container): # Check if the specified container network exists network_name = list(container_config['network'])[0] - if network_name not in container['network']: + if network_name not in container.get('network', {}): raise ConfigError(f'Container network "{network_name}" does not exist!') if 'address' in container_config['network'][network_name]: -- cgit v1.2.3