[PATCH 3/4] Raise exception if reading lines from a killed process

Vratislav Podzimek vpodzime at redhat.com
Fri Jul 25 10:37:01 UTC 2014


If process is killed and we try to read lines from its output, the caller should
be informed. Otherwise it simply continues with a notion that everything went
well and the output just finished.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/iutil.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
index 3f0cc0e..f783de3 100644
--- a/pyanaconda/iutil.py
+++ b/pyanaconda/iutil.py
@@ -268,6 +268,8 @@ def execReadlines(command, argv, stdin=None, root='/', env_prune=None):
             q.task_done()
         except Empty:
             if proc.poll() is not None:
+                if os.WIFSIGNALED(proc.returncode):
+                    raise OSError("process '%s' was killed" % argv)
                 break
     q.join()
 
-- 
1.9.3



More information about the anaconda-patches mailing list