mirror of https://github.com/docker/compose.git
Update to address code review feedback
Signed-off-by: Evan Shaw <evan@vendhq.com>
This commit is contained in:
parent
c6a271e57c
commit
b4b221f6a3
|
@ -607,7 +607,7 @@ class TopLevelCommand(object):
|
|||
self.project.pull(
|
||||
service_names=options['SERVICE'],
|
||||
ignore_pull_failures=options.get('--ignore-pull-failures'),
|
||||
in_parallel=options.get('--parallel')
|
||||
parallel_pull=options.get('--parallel')
|
||||
)
|
||||
|
||||
def push(self, options):
|
||||
|
|
|
@ -454,10 +454,10 @@ class Project(object):
|
|||
|
||||
return plans
|
||||
|
||||
def pull(self, service_names=None, ignore_pull_failures=False, in_parallel=False):
|
||||
def pull(self, service_names=None, ignore_pull_failures=False, parallel_pull=False):
|
||||
services = self.get_services(service_names, include_deps=False)
|
||||
|
||||
if in_parallel:
|
||||
if parallel_pull:
|
||||
def pull_service(service):
|
||||
service.pull(ignore_pull_failures, True)
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ from __future__ import absolute_import
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from collections import namedtuple
|
||||
|
@ -896,7 +897,11 @@ class Service(object):
|
|||
log.info('Pulling %s (%s%s%s)...' % (self.name, repo, separator, tag))
|
||||
try:
|
||||
output = self.client.pull(repo, tag=tag, stream=True)
|
||||
if not silent:
|
||||
if silent:
|
||||
with open(os.devnull, 'w') as devnull:
|
||||
return progress_stream.get_digest_from_pull(
|
||||
stream_output(output, devnull))
|
||||
else:
|
||||
return progress_stream.get_digest_from_pull(
|
||||
stream_output(output, sys.stdout))
|
||||
except (StreamOutputError, NotFound) as e:
|
||||
|
|
Loading…
Reference in New Issue