mirror of
https://github.com/docker/compose.git
synced 2025-07-29 16:44:20 +02:00
Fix exit code 0 upon parallel pull failure.
Signed-off-by: Aaron Nall <aronahl@hotmail.com>
This commit is contained in:
parent
43cb1f3dff
commit
f1baee3292
@ -498,13 +498,15 @@ class Project(object):
|
|||||||
def pull_service(service):
|
def pull_service(service):
|
||||||
service.pull(ignore_pull_failures, True)
|
service.pull(ignore_pull_failures, True)
|
||||||
|
|
||||||
parallel.parallel_execute(
|
_, errors = parallel.parallel_execute(
|
||||||
services,
|
services,
|
||||||
pull_service,
|
pull_service,
|
||||||
operator.attrgetter('name'),
|
operator.attrgetter('name'),
|
||||||
'Pulling',
|
'Pulling',
|
||||||
limit=5,
|
limit=5,
|
||||||
)
|
)
|
||||||
|
if len(errors):
|
||||||
|
raise ProjectError(b"\n".join(errors.values()))
|
||||||
else:
|
else:
|
||||||
for service in services:
|
for service in services:
|
||||||
service.pull(ignore_pull_failures, silent=silent)
|
service.pull(ignore_pull_failures, silent=silent)
|
||||||
|
@ -6,6 +6,7 @@ import datetime
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
|
import re
|
||||||
import signal
|
import signal
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
@ -448,6 +449,20 @@ class CLITestCase(DockerClientTestCase):
|
|||||||
assert self.dispatch(['pull', '--quiet']).stderr == ''
|
assert self.dispatch(['pull', '--quiet']).stderr == ''
|
||||||
assert self.dispatch(['pull', '--quiet']).stdout == ''
|
assert self.dispatch(['pull', '--quiet']).stdout == ''
|
||||||
|
|
||||||
|
def test_pull_with_parallel_failure(self):
|
||||||
|
result = self.dispatch([
|
||||||
|
'-f', 'ignore-pull-failures.yml', 'pull', '--parallel'],
|
||||||
|
returncode=1
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertRegexpMatches(result.stderr, re.compile('^Pulling simple', re.MULTILINE))
|
||||||
|
self.assertRegexpMatches(result.stderr, re.compile('^Pulling another', re.MULTILINE))
|
||||||
|
self.assertRegexpMatches(result.stderr,
|
||||||
|
re.compile('^ERROR: for another .*does not exist.*', re.MULTILINE))
|
||||||
|
self.assertRegexpMatches(result.stderr,
|
||||||
|
re.compile('''^(ERROR: )?(b')?.* nonexisting-image''',
|
||||||
|
re.MULTILINE))
|
||||||
|
|
||||||
def test_build_plain(self):
|
def test_build_plain(self):
|
||||||
self.base_dir = 'tests/fixtures/simple-dockerfile'
|
self.base_dir = 'tests/fixtures/simple-dockerfile'
|
||||||
self.dispatch(['build', 'simple'])
|
self.dispatch(['build', 'simple'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user