Add --quiet parameter to docker-compose pull, using existing silent flag

Signed-off-by: Joel Barciauskas <barciajo@gmail.com>
This commit is contained in:
Joel Barciauskas 2017-04-12 17:45:09 -04:00 committed by Joffrey F
parent d527f24ff0
commit e9b6cc23fc
3 changed files with 10 additions and 4 deletions

View File

@ -634,11 +634,13 @@ class TopLevelCommand(object):
Options:
--ignore-pull-failures Pull what it can and ignores images with pull failures.
--parallel Pull multiple images in parallel.
--quiet Pull without printing progress information
"""
self.project.pull(
service_names=options['SERVICE'],
ignore_pull_failures=options.get('--ignore-pull-failures'),
parallel_pull=options.get('--parallel')
parallel_pull=options.get('--parallel'),
silent=options.get('--quiet'),
)
def push(self, options):

View File

@ -462,12 +462,12 @@ class Project(object):
return plans
def pull(self, service_names=None, ignore_pull_failures=False, parallel_pull=False):
def pull(self, service_names=None, ignore_pull_failures=False, parallel_pull=False, silent=False):
services = self.get_services(service_names, include_deps=False)
if parallel_pull:
def pull_service(service):
service.pull(ignore_pull_failures, True)
service.pull(ignore_pull_failures, True, silent=silent)
parallel.parallel_execute(
services,
@ -477,7 +477,7 @@ class Project(object):
limit=5)
else:
for service in services:
service.pull(ignore_pull_failures)
service.pull(ignore_pull_failures, silent=silent)
def push(self, service_names=None, ignore_push_failures=False):
for service in self.get_services(service_names, include_deps=False):

View File

@ -431,6 +431,10 @@ class CLITestCase(DockerClientTestCase):
assert ('repository nonexisting-image not found' in result.stderr or
'image library/nonexisting-image:latest not found' in result.stderr)
def test_pull_with_quiet(self):
assert self.dispatch(['pull', '--quiet']).stderr == ''
assert self.dispatch(['pull', '--quiet']).stdout == ''
def test_build_plain(self):
self.base_dir = 'tests/fixtures/simple-dockerfile'
self.dispatch(['build', 'simple'])