docker: silence debootstrap when --quiet is given
authorSascha Silbe <silbe@linux.vnet.ibm.com>
Tue, 6 Sep 2016 20:05:51 +0000 (22:05 +0200)
committerFam Zheng <famz@redhat.com>
Thu, 8 Sep 2016 11:56:34 +0000 (19:56 +0800)
If we silence docker when --quiet is given, we should also silence the
.pre script (i.e. debootstrap).

Only discards stdout, so some diagnostics (e.g. from git clone) are
still printed. Most of the verbose output is gone however and this way
we still have a chance to see error messages.

Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Message-Id: <1473192351-601-9-git-send-email-silbe@linux.vnet.ibm.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
tests/docker/docker.py

index efb2bf4ac223311460ab6e16e087ecde2c487c37..b85c165130dea0d6d5b4d587f578e0c642b87efa 100755 (executable)
@@ -239,8 +239,9 @@ class BuildCommand(SubCommand):
             # Is there a .pre file to run in the build context?
             docker_pre = os.path.splitext(args.dockerfile)[0]+".pre"
             if os.path.exists(docker_pre):
+                stdout = DEVNULL if args.quiet else None
                 rc = subprocess.call(os.path.realpath(docker_pre),
-                                     cwd=docker_dir)
+                                     cwd=docker_dir, stdout=stdout)
                 if rc == 3:
                     print "Skip"
                     return 0