Allow string for command

Fixes a regression compared to docker-compose. F.ex.

    command: --smallfiles

got translated to

    - - s m a l l f i l e s

on the command line. If option value is a string create a list with a
single entry before adding it to the command line.
This commit is contained in:
Stefan Becker 2019-07-08 09:12:25 +03:00
parent 26df0a377f
commit 48a24e323b

View File

@ -477,8 +477,10 @@ def container_to_args(cnt, dirname, podman_path, shared_vols):
args.append(cnt.get('image')) # command, ..etc.
command = cnt.get('command')
if command is not None:
# TODO: handle if command is string
args.extend(command)
if is_str(command):
args.extend([command])
else:
args.extend(command)
return args