From ded2a1753842da80e690881ff1f4d003a6b54152 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Wed, 9 Oct 2019 13:41:29 -0400 Subject: [PATCH] podman_container: only add --volume if item not empty Make sure the item in the list of volumes isn't empty or we can end up with a user error where the item is '' and podman will crash with: "host directory can not be empty" Note that I hit that since we have some conditional volumes in THT, where sometimes we get '' in the list of volumes. Let's handle this case. Change-Id: I8df1fb5d1bb72bd492e9f8e2b29dc6dae09d6b44 --- tripleo_ansible/ansible_plugins/modules/podman_container.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tripleo_ansible/ansible_plugins/modules/podman_container.py b/tripleo_ansible/ansible_plugins/modules/podman_container.py index fe2a90ebb..2468685d0 100644 --- a/tripleo_ansible/ansible_plugins/modules/podman_container.py +++ b/tripleo_ansible/ansible_plugins/modules/podman_container.py @@ -1147,7 +1147,8 @@ class PodmanModuleParams: def addparam_volume(self, c): for vol in self.params['volume']: - c += ['--volume', vol] + if vol: + c += ['--volume', vol] return c def addparam_volumes_from(self, c):