From f85da99ef3273794e855afda8678174419d3bf4f Mon Sep 17 00:00:00 2001 From: Evan Shaw <evan@vendhq.com> Date: Mon, 13 Feb 2017 16:16:07 +1300 Subject: [PATCH] Silence service pull output when pulling in parallel Signed-off-by: Evan Shaw <evan@vendhq.com> --- compose/project.py | 2 +- compose/service.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/compose/project.py b/compose/project.py index 8d34d8eae..d02d8ece3 100644 --- a/compose/project.py +++ b/compose/project.py @@ -456,7 +456,7 @@ class Project(object): def pull(self, service_names=None, ignore_pull_failures=False): def pull_service(service): - service.pull(ignore_pull_failures) + service.pull(ignore_pull_failures, True) services = self.get_services(service_names, include_deps=False) parallel.parallel_execute( diff --git a/compose/service.py b/compose/service.py index 023efa274..0eadadfb9 100644 --- a/compose/service.py +++ b/compose/service.py @@ -886,17 +886,19 @@ class Service(object): return any(has_host_port(binding) for binding in self.options.get('ports', [])) - def pull(self, ignore_pull_failures=False): + def pull(self, ignore_pull_failures=False, silent=False): if 'image' not in self.options: return repo, tag, separator = parse_repository_tag(self.options['image']) tag = tag or 'latest' - log.info('Pulling %s (%s%s%s)...' % (self.name, repo, separator, tag)) + if not silent: + log.info('Pulling %s (%s%s%s)...' % (self.name, repo, separator, tag)) try: output = self.client.pull(repo, tag=tag, stream=True) - return progress_stream.get_digest_from_pull( - stream_output(output, sys.stdout)) + if not silent: + return progress_stream.get_digest_from_pull( + stream_output(output, sys.stdout)) except (StreamOutputError, NotFound) as e: if not ignore_pull_failures: raise