From e28238dc33194c155de2c00419e67123a1a978a2 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sat, 11 Jul 2015 17:40:54 -0500 Subject: [PATCH] stage3: Fetcher.fetch_stage: Pass stderr fd to wget The main entry point of the `mkvm` program closes FD 3 (native stderr) to prevent extraneous messages from libvirt. Unfortunately, this breaks wget's progress indicator, as it is printed to stderr as well. To ensure that the progress indicator works, we have to pass the FD of the copy of stderr to wget. --- src/mkvm/stage3.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mkvm/stage3.py b/src/mkvm/stage3.py index ab898f4..e2f31da 100644 --- a/src/mkvm/stage3.py +++ b/src/mkvm/stage3.py @@ -6,6 +6,7 @@ import io import os import shutil import subprocess +import sys import time import urllib.parse import urllib.request @@ -102,7 +103,7 @@ class Fetcher(object): cmd += uris log.debug('Running command: {}'.format(' '.join(cmd))) try: - p = subprocess.Popen(cmd, cwd=self.cache_dir) + p = subprocess.Popen(cmd, cwd=self.cache_dir, stderr=sys.stderr) except OSError as e: raise FetchError('Failed to run wget: {}'.format(e)) if p.wait() != 0: