Browse Source

Revert "docker/compose: quote health-cmd"

This reverts commit 9fbbad559d.
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
changes/51/665251/2
Emilien Macchi 1 month ago
parent
commit
a809d783e7
2 changed files with 3 additions and 3 deletions
  1. 1
    1
      paunch/builder/compose1.py
  2. 2
    2
      paunch/tests/test_builder_compose1.py

+ 1
- 1
paunch/builder/compose1.py View File

@@ -44,7 +44,7 @@ class ComposeV1Builder(base.BaseBuilder):
44 44
         if 'healthcheck' in cconfig:
45 45
             hconfig = cconfig['healthcheck']
46 46
             if 'test' in hconfig:
47
-                cmd.append('--health-cmd="%s"' % hconfig['test'])
47
+                cmd.append('--health-cmd=%s' % hconfig['test'])
48 48
             if 'interval' in hconfig:
49 49
                 cmd.append('--health-interval=%s' % hconfig['interval'])
50 50
             if 'timeout' in hconfig:

+ 2
- 2
paunch/tests/test_builder_compose1.py View File

@@ -29,7 +29,7 @@ class TestComposeV1Builder(tbb.TestBaseBuilder):
29 29
                 'uts': 'host',
30 30
                 'restart': 'always',
31 31
                 'healthcheck': {
32
-                    'test': 'ls /mydir',
32
+                    'test': '/bin/true',
33 33
                     'interval': '30s',
34 34
                     'timeout': '10s',
35 35
                     'retries': 3
@@ -59,7 +59,7 @@ class TestComposeV1Builder(tbb.TestBaseBuilder):
59 59
             ['docker', 'run', '--name', 'one',
60 60
              '--detach=true', '--env-file=/tmp/foo.env',
61 61
              '--net=host', '--ipc=host', '--pid=container:bar',
62
-             '--uts=host', '--health-cmd="ls /mydir"', '--health-interval=30s',
62
+             '--uts=host', '--health-cmd=/bin/true', '--health-interval=30s',
63 63
              '--health-timeout=10s', '--health-retries=3',
64 64
              '--privileged=true', '--restart=always', '--user=bar',
65 65
              '--log-opt=tag={{.ImageName}}/{{.Name}}/{{.ID}}',

Loading…
Cancel
Save