summaryrefslogtreecommitdiffstats
path: root/exception.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2001-06-26 22:43:32 +0000
committerMatt Wilson <msw@redhat.com>2001-06-26 22:43:32 +0000
commit4f4c64552c1d924a26df77df7c3090d4a7b63770 (patch)
tree94d091341aa623ead26e5e41f9a7c3d48778321f /exception.py
parentff290f9dadecb380fc8ae371660c3d6493502189 (diff)
downloadanaconda-4f4c64552c1d924a26df77df7c3090d4a7b63770.tar.gz
anaconda-4f4c64552c1d924a26df77df7c3090d4a7b63770.tar.xz
anaconda-4f4c64552c1d924a26df77df7c3090d4a7b63770.zip
partitioning.py: skip removable partitions except in expert mode
exception.py: if not setupFilesystems save dump to a file 'anacdump.txt' in cwd
Diffstat (limited to 'exception.py')
-rw-r--r--exception.py72
1 files changed, 41 insertions, 31 deletions
diff --git a/exception.py b/exception.py
index 9b62e6e36..cdda853fd 100644
--- a/exception.py
+++ b/exception.py
@@ -17,11 +17,40 @@
import isys
import os
import signal
-from string import joinfields
import traceback
+import iutil
+from string import joinfields
from cPickle import Pickler
from translate import _
-import iutil
+from flags import flags
+
+def dumpException(out, text, tb, id):
+ p = Pickler(out)
+
+ out.write(text)
+
+ trace = tb
+ while trace.tb_next:
+ trace = trace.tb_next
+ frame = trace.tb_frame
+ out.write ("\nLocal variables in innermost frame:\n")
+ for (key, value) in frame.f_locals.items():
+ out.write ("%s: %s\n" % (key, value))
+
+ out.write("\nToDo object:\n")
+
+ # these have C objects in them which can't dump
+ id.hdList = None
+ id.comps = None
+
+ # we don't need to know passwords
+ id.rootPassword = None
+ id.accounts = None
+
+ try:
+ p.dump(id)
+ except:
+ out.write("\n<failed>\n")
def handleException( id, intf, (type, value, tb)):
list = traceback.format_exception (type, value, tb)
@@ -36,7 +65,14 @@ def handleException( id, intf, (type, value, tb)):
elif not rc:
intf.__del__ ()
os.kill(os.getpid(), signal.SIGKILL)
-
+
+ if not flags.setupFilesystems:
+ out = open("anacdump.txt", "w")
+ dumpException (out, text, tb, id)
+ out.close()
+ intf.__del__ ()
+ os.kill(os.getpid(), signal.SIGKILL)
+
while 1:
rc = intf.dumpWindow()
if rc:
@@ -75,34 +111,8 @@ def handleException( id, intf, (type, value, tb)):
continue
out = open("/tmp/crash/anacdump.txt", "w")
- p = Pickler(out)
-
- out.write(text)
-
- trace = tb
- while trace.tb_next:
- trace = trace.tb_next
- frame = trace.tb_frame
- out.write ("\nLocal variables in innermost frame:\n")
- for (key, value) in frame.f_locals.items():
- out.write ("%s: %s\n" % (key, value))
-
- out.write("\nToDo object:\n")
-
- # these have C objects in them which can't dump
- id.hdList = None
- id.comps = None
-
- # we don't need to know passwords
- id.rootPassword = None
- id.accounts = None
-
- try:
- p.dump(id)
- except:
- out.write("\n<failed>\n")
-
- out.close()
+ dumpException (out, text, tb, id)
+ out.close()
# write out any syslog information as well
try: