7041751 solaris_install._LogBuffer misbehaves in read_filehandle() if flush=True
authorKeith Mitchell <keith.mitchell@oracle.com>
Wed, 04 May 2011 11:45:21 -0700
changeset 1104 31b8f597e30a
parent 1103 bb9177285efa
child 1105 f611cbe233ce
7041751 solaris_install._LogBuffer misbehaves in read_filehandle() if flush=True
usr/src/lib/install_common/__init__.py
--- a/usr/src/lib/install_common/__init__.py	Tue May 03 08:09:47 2011 -0600
+++ b/usr/src/lib/install_common/__init__.py	Wed May 04 11:45:21 2011 -0700
@@ -107,7 +107,10 @@
             # and add the output to the list of all output
             # captured so far. Trailing newline is stripped,
             # as it is expected that the logger will *add* one
-            end_buf, newline, begin_buf = output.partition("\n")
+            if flush:
+                end_buf, newline, begin_buf = output, '', ''
+            else:
+                end_buf, newline, begin_buf = output.rpartition("\n")
             self._buffer.append(end_buf)
             flush_out = "".join(self._buffer)