mirror of
https://github.com/docker/compose.git
synced 2025-07-27 07:34:10 +02:00
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(
|
self.project.pull(
|
||||||
service_names=options['SERVICE'],
|
service_names=options['SERVICE'],
|
||||||
ignore_pull_failures=options.get('--ignore-pull-failures'),
|
ignore_pull_failures=options.get('--ignore-pull-failures'),
|
||||||
in_parallel=options.get('--parallel')
|
parallel_pull=options.get('--parallel')
|
||||||
)
|
)
|
||||||
|
|
||||||
def push(self, options):
|
def push(self, options):
|
||||||
|
@ -454,10 +454,10 @@ class Project(object):
|
|||||||
|
|
||||||
return plans
|
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)
|
services = self.get_services(service_names, include_deps=False)
|
||||||
|
|
||||||
if in_parallel:
|
if parallel_pull:
|
||||||
def pull_service(service):
|
def pull_service(service):
|
||||||
service.pull(ignore_pull_failures, True)
|
service.pull(ignore_pull_failures, True)
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ from __future__ import absolute_import
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
@ -896,7 +897,11 @@ class Service(object):
|
|||||||
log.info('Pulling %s (%s%s%s)...' % (self.name, repo, separator, tag))
|
log.info('Pulling %s (%s%s%s)...' % (self.name, repo, separator, tag))
|
||||||
try:
|
try:
|
||||||
output = self.client.pull(repo, tag=tag, stream=True)
|
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(
|
return progress_stream.get_digest_from_pull(
|
||||||
stream_output(output, sys.stdout))
|
stream_output(output, sys.stdout))
|
||||||
except (StreamOutputError, NotFound) as e:
|
except (StreamOutputError, NotFound) as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user