summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-08-23 15:50:48 +0200
committerChristian Poessinger <christian@poessinger.com>2021-08-23 15:50:48 +0200
commitb48f7688f758921904fb6ef5185080d97c1e3920 (patch)
tree111878160ac2042a0e39eb591470fadcef247b48
parentc270fe05596c95eca20a96a8c7e561d28bfc9a82 (diff)
downloadvyos-1x-b48f7688f758921904fb6ef5185080d97c1e3920.tar.gz
vyos-1x-b48f7688f758921904fb6ef5185080d97c1e3920.zip
container: T2216: bugfix ValueError when assembling volumes
A call to .items() was missing that triggered the following error: ValueError: too many values to unpack (expected 2)
-rwxr-xr-xsrc/conf_mode/containers.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/conf_mode/containers.py b/src/conf_mode/containers.py
index 12e6953b5..2c4861449 100755
--- a/src/conf_mode/containers.py
+++ b/src/conf_mode/containers.py
@@ -237,12 +237,14 @@ def apply(container):
# Bind volume
volume = ''
if 'volume' in container_config:
- for vol, vol_config in container_config['volume']:
+ for vol, vol_config in container_config['volume'].items():
svol = vol_config['source']
dvol = vol_config['destination']
volume += f' -v {svol}:{dvol}'
- container_base_cmd = f'podman run --detach --interactive --tty --replace --memory {memory}m --restart {restart} --name {name} {port} {volume} {env_opt}'
+ container_base_cmd = f'podman run --detach --interactive --tty --replace ' \
+ f'--memory {memory}m --memory-swap 0 --restart {restart} ' \
+ f'--name {name} {port} {volume} {env_opt}'
if 'allow_host_networks' in container_config:
_cmd(f'{container_base_cmd} --net host {image}')
else: