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: I066fb243caa7f9fd819a7f91c47857b3aa678807
Related-Bug: #1824808
tags/4.5.0
Emilien Macchi 1 month ago
parent
commit
fb760307b3
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
@@ -53,7 +53,7 @@ class TestComposeV1Builder(tbb.TestBaseBuilder):
53 53
             ['docker', 'run', '--name', 'one',
54 54
              '--detach=true', '--env-file=/tmp/foo.env',
55 55
              '--net=host', '--ipc=host', '--pid=container:bar',
56
-             '--uts=host', '--health-cmd="ls /mydir"', '--health-interval=30s',
56
+             '--uts=host', '--health-cmd=/bin/true', '--health-interval=30s',
57 57
              '--health-timeout=10s', '--health-retries=3',
58 58
              '--privileged=true', '--restart=always', '--user=bar',
59 59
              '--log-opt=tag={{.ImageName}}/{{.Name}}/{{.ID}}',

Loading…
Cancel
Save