summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-05-09 14:52:14 +0300
committerLars Wirzenius <liw@liw.fi>2020-05-09 14:52:14 +0300
commit1c1999662da0b3fcfcfa224118809e8b236bb318 (patch)
tree84c02f6c435c983e06cd256333176001f1c65c44
parentf86d245067d334d7b241f4bf1a69a7cae68c8197 (diff)
downloadvmdb2-1c1999662da0b3fcfcfa224118809e8b236bb318.tar.gz
Change: flush progress output after every write
-rw-r--r--NEWS9
-rw-r--r--vmdb/runcmd.py2
2 files changed, 11 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index f9766ce..e17d765 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,15 @@
NEWS for vmdb2, the Debian disk image builder
=============================================================================
+Version 0.15+git, not yet released
+------------------------------------
+
+* Progress output is now flushed after every write. This matters, when
+ the output goes to a pipe, because then Python would buffer the
+ output, meaning that progress output gets delayed until the buffer
+ fills up, and that's useless.
+
+
Version 0.15, released 2020-05-05
------------------------------------
diff --git a/vmdb/runcmd.py b/vmdb/runcmd.py
index ae4a6d0..7cd6406 100644
--- a/vmdb/runcmd.py
+++ b/vmdb/runcmd.py
@@ -35,12 +35,14 @@ def set_verbose_progress(verbose):
def error(msg):
logging.error(msg, exc_info=True)
sys.stderr.write('ERROR: {}\n'.format(msg))
+ sys.stderr.flush()
def progress(msg):
logging.info(msg)
if _verbose:
sys.stdout.write('{}\n'.format(msg))
+ sys.stdout.flush()
def runcmd(argv, **kwargs):