diff options
author | Peter Jones <pjones@redhat.com> | 2008-08-08 15:57:41 -0400 |
---|---|---|
committer | Peter Jones <pjones@pjones2.localdomain> | 2008-08-08 15:57:41 -0400 |
commit | a9e04cc7ee472112259eb0868c43d118c2f09a92 (patch) | |
tree | 758452a1455980dc744e31bb0591c30ca54098c7 /errors.py | |
parent | 7a3f0f3e612c28dfd1df1ee81365c8a56c14c735 (diff) | |
download | anaconda-a9e04cc7ee472112259eb0868c43d118c2f09a92.tar.gz anaconda-a9e04cc7ee472112259eb0868c43d118c2f09a92.tar.xz anaconda-a9e04cc7ee472112259eb0868c43d118c2f09a92.zip |
Fix LVM error handling so the exceptions actually get into the namespace.
Diffstat (limited to 'errors.py')
-rw-r--r-- | errors.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -24,7 +24,8 @@ # import string -from lvm import output +import os +from constants import lvmErrorOutput """Exceptions for use in lvm operations.""" @@ -36,7 +37,9 @@ class LvmError(Exception): self.log = self.getLvmOutput() def getLvmOutput(self): - f = open(output, "r") + if not os.access(lvmErrorOutput, os.R_OK): + return "" + f = open(lvmErrorOutput, "r") lines = reduce(lambda x,y: x + [string.strip(y),], f.readlines(), []) lines = string.join(reduce(lambda x,y: x + [" %s" % (y,)], \ lines, []), "\n") |