summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2022-06-28 12:03:56 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2022-06-28 12:03:56 +0000
commit1e645f7a567178a0af444a08e87987eeaed557c5 (patch)
tree324b3045e6c43844115cc032b700d201a7784b3b /src
parent49d7ba83958a44b92d80da33cef25ff666a55d7b (diff)
downloadvyos-1x-1e645f7a567178a0af444a08e87987eeaed557c5.tar.gz
vyos-1x-1e645f7a567178a0af444a08e87987eeaed557c5.zip
containers: T4473: Fix create container with not exist network
Fix for setting container without or wrong network decalaration
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/container.py2
1 files changed, 1 insertions, 1 deletions
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]: