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
This commit is contained in:
Emilien Macchi 2019-10-09 13:41:29 -04:00
parent 7fa3b4ebae
commit ded2a17538
1 changed files with 2 additions and 1 deletions

View File

@ -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):