From fb760307b3baf45dbbc19a5de2a290526830bf17 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Thu, 13 Jun 2019 22:01:04 +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: I066fb243caa7f9fd819a7f91c47857b3aa678807 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 1214066..e26ac45 100644 --- a/paunch/builder/compose1.py +++ b/paunch/builder/compose1.py @@ -44,7 +44,7 @@ class ComposeV1Builder(base.BaseBuilder): 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 dc922c2..c470712 100644 --- a/paunch/tests/test_builder_compose1.py +++ b/paunch/tests/test_builder_compose1.py @@ -29,7 +29,7 @@ class TestComposeV1Builder(tbb.TestBaseBuilder): 'uts': 'host', 'restart': 'always', 'healthcheck': { - 'test': 'ls /mydir', + 'test': '/bin/true', 'interval': '30s', 'timeout': '10s', 'retries': 3 @@ -53,7 +53,7 @@ class TestComposeV1Builder(tbb.TestBaseBuilder): ['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}}',