summaryrefslogtreecommitdiffstats
path: root/pyanaconda/iutil.py
diff options
context:
space:
mode:
authorAles Kozumplik <akozumpl@redhat.com>2011-02-16 14:50:18 +0100
committerAles Kozumplik <akozumpl@redhat.com>2011-02-21 10:07:50 +0100
commit58e76d37ed8e55e4ac8f5e02febbc242a6a3bc4e (patch)
treeef0b694d50ded9310e11d728689ab2ff96f8df2d /pyanaconda/iutil.py
parente3aa013ea43c93c00a0b8c3efced070c2fe6ca8b (diff)
downloadanaconda-58e76d37ed8e55e4ac8f5e02febbc242a6a3bc4e.tar.gz
anaconda-58e76d37ed8e55e4ac8f5e02febbc242a6a3bc4e.tar.xz
anaconda-58e76d37ed8e55e4ac8f5e02febbc242a6a3bc4e.zip
Be better at handling killed metacity.
Resolves: rhbz#677605
Diffstat (limited to 'pyanaconda/iutil.py')
-rw-r--r--pyanaconda/iutil.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
index 1e6e581ba..197bf1516 100644
--- a/pyanaconda/iutil.py
+++ b/pyanaconda/iutil.py
@@ -48,16 +48,22 @@ class ExecProduct(object):
#Python reimplementation of the shell tee process, so we can
#feed the pipe output into two places at the same time
class tee(threading.Thread):
- def __init__(self, inputdesc, outputdesc, logmethod):
+ def __init__(self, inputdesc, outputdesc, logmethod, command):
threading.Thread.__init__(self)
self.inputdesc = os.fdopen(inputdesc, "r")
self.outputdesc = outputdesc
self.logmethod = logmethod
self.running = True
+ self.command = command
def run(self):
while self.running:
- data = self.inputdesc.readline()
+ try:
+ data = self.inputdesc.readline()
+ except IOError:
+ self.logmethod("Can't read from pipe during a call to %s. "
+ "(program terminated suddenly?)" % self.command)
+ break
if data == "":
self.running = False
else:
@@ -122,8 +128,8 @@ def execWithRedirect(command, argv, stdin = None, stdout = None,
try:
#prepare tee proceses
- proc_std = tee(pstdout, stdout, program_log.info)
- proc_err = tee(perrout, stderr, program_log.error)
+ proc_std = tee(pstdout, stdout, program_log.info, command)
+ proc_err = tee(perrout, stderr, program_log.error, command)
#start monitoring the outputs
proc_std.start()