mirror of https://github.com/docker/compose.git
Merge pull request #6346 from collin5/b5469
Show failed services 'docker-compose start' when containers are not availabe
This commit is contained in:
commit
14e7a11b3c
|
@ -50,7 +50,11 @@ def parallel_execute_watch(events, writer, errors, results, msg, get_name):
|
|||
error_to_reraise = None
|
||||
for obj, result, exception in events:
|
||||
if exception is None:
|
||||
writer.write(msg, get_name(obj), 'done', green)
|
||||
if callable(getattr(obj, 'containers', None)) and not obj.containers():
|
||||
# If service has no containers started
|
||||
writer.write(msg, get_name(obj), 'failed', red)
|
||||
else:
|
||||
writer.write(msg, get_name(obj), 'done', green)
|
||||
results.append(result)
|
||||
elif isinstance(exception, ImageNotFound):
|
||||
# This is to bubble up ImageNotFound exceptions to the client so we
|
||||
|
|
|
@ -2228,6 +2228,7 @@ class CLITestCase(DockerClientTestCase):
|
|||
|
||||
def test_start_no_containers(self):
|
||||
result = self.dispatch(['start'], returncode=1)
|
||||
assert 'failed' in result.stderr
|
||||
assert 'No containers to start' in result.stderr
|
||||
|
||||
@v2_only()
|
||||
|
|
Loading…
Reference in New Issue