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: Ibd97df51b7eede9c8c617777bd5255d075954db2
Related-Bug: #1824808
tags/2.5.2^0
Emilien Macchi 1 month ago
parent
commit
90cf8bbb3e
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

@@ -165,7 +165,7 @@ class ComposeV1Builder(object):
165 165
         if 'healthcheck' in cconfig:
166 166
             hconfig = cconfig['healthcheck']
167 167
             if 'test' in hconfig:
168
-                cmd.append('--health-cmd="%s"' % hconfig['test'])
168
+                cmd.append('--health-cmd=%s' % hconfig['test'])
169 169
             if 'interval' in hconfig:
170 170
                 cmd.append('--health-interval=%s' % hconfig['interval'])
171 171
             if 'timeout' in hconfig:

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

@@ -424,7 +424,7 @@ three-12345678 three''', '', 0),
424 424
                 'uts': 'host',
425 425
                 'restart': 'always',
426 426
                 'healthcheck': {
427
-                    'test': 'ls /mydir',
427
+                    'test': '/bin/true',
428 428
                     'interval': '30s',
429 429
                     'timeout': '10s',
430 430
                     'retries': 3
@@ -442,7 +442,7 @@ three-12345678 three''', '', 0),
442 442
             ['docker', 'run', '--name', 'one',
443 443
              '--detach=true', '--env-file=/tmp/foo.env',
444 444
              '--net=host', '--ipc=host', '--pid=container:bar',
445
-             '--uts=host', '--health-cmd="ls /mydir"', '--health-interval=30s',
445
+             '--uts=host', '--health-cmd=/bin/true', '--health-interval=30s',
446 446
              '--health-timeout=10s', '--health-retries=3',
447 447
              '--privileged=true', '--restart=always', '--user=bar',
448 448
              '--log-opt=tag={{.ImageName}}/{{.Name}}/{{.ID}}',

Loading…
Cancel
Save