summaryrefslogtreecommitdiffstats
path: root/errors.py
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2008-08-08 15:57:41 -0400
committerPeter Jones <pjones@pjones2.localdomain>2008-08-08 15:57:41 -0400
commita9e04cc7ee472112259eb0868c43d118c2f09a92 (patch)
tree758452a1455980dc744e31bb0591c30ca54098c7 /errors.py
parent7a3f0f3e612c28dfd1df1ee81365c8a56c14c735 (diff)
downloadanaconda-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.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/errors.py b/errors.py
index b0f663c4d..e7bc3ce5f 100644
--- a/errors.py
+++ b/errors.py
@@ -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")