summaryrefslogtreecommitdiffstats
path: root/partedUtils.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2007-11-28 17:24:08 -0500
committerChris Lumens <clumens@redhat.com>2007-11-28 17:37:57 -0500
commitc0eeb462f23ca31280644f88904fa209c3450cfb (patch)
treeeceb95ceb07536f1e0bb35d0426bd9c64f8568e1 /partedUtils.py
parenta08205562cc31ae02ccdec4eae2502111f457857 (diff)
downloadanaconda-c0eeb462f23ca31280644f88904fa209c3450cfb.tar.gz
anaconda-c0eeb462f23ca31280644f88904fa209c3450cfb.tar.xz
anaconda-c0eeb462f23ca31280644f88904fa209c3450cfb.zip
Fix tracebacks when printing disk errors (#403501).
When errors are encountered in labeling and trying to make > 15 partitions, tracebacks can occur in the error printing if there's no anaconda instance. This fixes those tracebacks so the error messages are logged correctly.
Diffstat (limited to 'partedUtils.py')
-rw-r--r--partedUtils.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/partedUtils.py b/partedUtils.py
index ae095e6c9..d3b1cf8e8 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -21,6 +21,7 @@ import parted
import math
import os, sys, string, struct, resource
+from exception import formatException
from product import *
import fsset
import iutil, isys
@@ -1105,9 +1106,9 @@ class DiskSet:
log.error("parted error: %s" % (msg,))
raise
except:
- exc = sys.exc_info()
- exc = traceback.format_exception(*exc)
- for line in exc.splitlines():
+ (type, value, tb) = sys.exc_info()
+ lines = formatException(type, value, tb)
+ for line in lines:
log.error(line)
self._removeDisk(drive)
raise LabelError, drive
@@ -1239,9 +1240,9 @@ class DiskSet:
if rc == 0:
sys.exit(0)
else:
- exc = sys.exc_info()
- exc = traceback.format_exception(*exc)
- for line in exc.splitlines():
+ (type, value, tb) = sys.exc_info()
+ lines = formatException(type, value, tb)
+ for line in lines:
log.error(line)
log.error(str)
sys.exit(0)