Browse Source

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

Signed-off-by: Joel Barciauskas <[email protected]>
Joel Barciauskas 8 years ago
parent
commit
e9b6cc23fc
3 changed files with 10 additions and 4 deletions
  1. 3 1
      compose/cli/main.py
  2. 3 3
      compose/project.py
  3. 4 0
      tests/acceptance/cli_test.py

+ 3 - 1
compose/cli/main.py

@@ -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):

+ 3 - 3
compose/project.py

@@ -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):

+ 4 - 0
tests/acceptance/cli_test.py

@@ -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'])