From c7b76b1d128a3c4d4bb5deb50633062698b3df3e Mon Sep 17 00:00:00 2001 From: Matthieu Nottale Date: Thu, 15 Mar 2018 15:40:13 +0100 Subject: [PATCH 1/2] pull: Honor --quiet in parallel mode. Signed-off-by: Matthieu Nottale --- compose/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose/project.py b/compose/project.py index 2cbc4aeea..48095e938 100644 --- a/compose/project.py +++ b/compose/project.py @@ -551,7 +551,7 @@ class Project(object): services, pull_service, operator.attrgetter('name'), - 'Pulling', + not silent and 'Pulling' or None, limit=5, ) if len(errors): From 83364078300340cabaad95d5d0e37954b52e3c30 Mon Sep 17 00:00:00 2001 From: Matthieu Nottale Date: Thu, 15 Mar 2018 14:10:20 +0100 Subject: [PATCH 2/2] pull: Deprecate '--parallel' and enable it by default. Signed-off-by: Matthieu Nottale --- compose/cli/main.py | 7 +++++-- tests/acceptance/cli_test.py | 16 +++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/compose/cli/main.py b/compose/cli/main.py index 59f111184..9e49e2974 100644 --- a/compose/cli/main.py +++ b/compose/cli/main.py @@ -711,14 +711,17 @@ class TopLevelCommand(object): Options: --ignore-pull-failures Pull what it can and ignores images with pull failures. - --parallel Pull multiple images in parallel. + --parallel Deprecated, pull multiple images in parallel (enabled by default). + --no-parallel Disable parallel pulling. -q, --quiet Pull without printing progress information --include-deps Also pull services declared as dependencies """ + if options.get('--parallel'): + log.warn('--parallel option is deprecated and will be removed in future versions.') self.project.pull( service_names=options['SERVICE'], ignore_pull_failures=options.get('--ignore-pull-failures'), - parallel_pull=options.get('--parallel'), + parallel_pull=not options.get('--no-parallel'), silent=options.get('--quiet'), include_deps=options.get('--include-deps'), ) diff --git a/tests/acceptance/cli_test.py b/tests/acceptance/cli_test.py index 45e9a54e5..0366df51e 100644 --- a/tests/acceptance/cli_test.py +++ b/tests/acceptance/cli_test.py @@ -545,13 +545,11 @@ class CLITestCase(DockerClientTestCase): def test_pull(self): result = self.dispatch(['pull']) - assert sorted(result.stderr.split('\n'))[1:] == [ - 'Pulling another (busybox:latest)...', - 'Pulling simple (busybox:latest)...', - ] + assert 'Pulling simple' in result.stderr + assert 'Pulling another' in result.stderr def test_pull_with_digest(self): - result = self.dispatch(['-f', 'digest.yml', 'pull']) + result = self.dispatch(['-f', 'digest.yml', 'pull', '--no-parallel']) assert 'Pulling simple (busybox:latest)...' in result.stderr assert ('Pulling digest (busybox@' @@ -561,7 +559,7 @@ class CLITestCase(DockerClientTestCase): def test_pull_with_ignore_pull_failures(self): result = self.dispatch([ '-f', 'ignore-pull-failures.yml', - 'pull', '--ignore-pull-failures'] + 'pull', '--ignore-pull-failures', '--no-parallel'] ) assert 'Pulling simple (busybox:latest)...' in result.stderr @@ -576,7 +574,7 @@ class CLITestCase(DockerClientTestCase): def test_pull_with_parallel_failure(self): result = self.dispatch([ - '-f', 'ignore-pull-failures.yml', 'pull', '--parallel'], + '-f', 'ignore-pull-failures.yml', 'pull'], returncode=1 ) @@ -593,14 +591,14 @@ class CLITestCase(DockerClientTestCase): def test_pull_with_no_deps(self): self.base_dir = 'tests/fixtures/links-composefile' - result = self.dispatch(['pull', 'web']) + result = self.dispatch(['pull', '--no-parallel', 'web']) assert sorted(result.stderr.split('\n'))[1:] == [ 'Pulling web (busybox:latest)...', ] def test_pull_with_include_deps(self): self.base_dir = 'tests/fixtures/links-composefile' - result = self.dispatch(['pull', '--include-deps', 'web']) + result = self.dispatch(['pull', '--no-parallel', '--include-deps', 'web']) assert sorted(result.stderr.split('\n'))[1:] == [ 'Pulling db (busybox:latest)...', 'Pulling web (busybox:latest)...',