From a809d783e7e50030f7dc740a9aaec5dc9c560210 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Thu, 13 Jun 2019 22:01:16 +0000 Subject: [PATCH] Revert "docker/compose: quote health-cmd" This reverts commit 9fbbad559dcffaf4d57c5c1c244db3b80e09106c. This patch was wrong. We don't need the quotes because we use subprocess and the args aren't parsed lie on bash. Change-Id: I47a6dd2f57809c02d57b0772e6c17150cb6687b3 Related-Bug: #1824808 --- paunch/builder/compose1.py | 2 +- paunch/tests/test_builder_compose1.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paunch/builder/compose1.py b/paunch/builder/compose1.py index bdb068b..4d589ae 100644 --- a/paunch/builder/compose1.py +++ b/paunch/builder/compose1.py @@ -44,7 +44,7 @@ def container_run_args(self, cmd, container): if 'healthcheck' in cconfig: hconfig = cconfig['healthcheck'] if 'test' in hconfig: - cmd.append('--health-cmd="%s"' % hconfig['test']) + cmd.append('--health-cmd=%s' % hconfig['test']) if 'interval' in hconfig: cmd.append('--health-interval=%s' % hconfig['interval']) if 'timeout' in hconfig: diff --git a/paunch/tests/test_builder_compose1.py b/paunch/tests/test_builder_compose1.py index d896209..4b46bfc 100644 --- a/paunch/tests/test_builder_compose1.py +++ b/paunch/tests/test_builder_compose1.py @@ -29,7 +29,7 @@ def test_cont_run_args(self): 'uts': 'host', 'restart': 'always', 'healthcheck': { - 'test': 'ls /mydir', + 'test': '/bin/true', 'interval': '30s', 'timeout': '10s', 'retries': 3 @@ -59,7 +59,7 @@ def test_cont_run_args(self): ['docker', 'run', '--name', 'one', '--detach=true', '--env-file=/tmp/foo.env', '--net=host', '--ipc=host', '--pid=container:bar', - '--uts=host', '--health-cmd="ls /mydir"', '--health-interval=30s', + '--uts=host', '--health-cmd=/bin/true', '--health-interval=30s', '--health-timeout=10s', '--health-retries=3', '--privileged=true', '--restart=always', '--user=bar', '--log-opt=tag={{.ImageName}}/{{.Name}}/{{.ID}}',