summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xanaconda14
-rw-r--r--exception.py5
2 files changed, 17 insertions, 2 deletions
diff --git a/anaconda b/anaconda
index ade122dc6..624c19ca1 100755
--- a/anaconda
+++ b/anaconda
@@ -502,6 +502,15 @@ class Anaconda:
# *sigh* we still need to be able to write this out
self.xdriver = None
+ def dumpState(self):
+ from exception import AnacondaExceptionDump
+ from inspect import stack as _stack
+ # Skip the frames for dumpState and the signal handler.
+ stack = _stack()[2:]
+ stack.reverse()
+ exn = AnacondaExceptionDump(None, None, stack)
+ exn.write(anaconda)
+
def writeXdriver(self, instPath="/"):
# this should go away at some point, but until it does, we
# need to keep it around. it could go into instdata but this
@@ -609,7 +618,7 @@ if __name__ == "__main__":
# this handles setting up updates for pypackages to minimize the set needed
setupPythonUpdates()
- import signal, traceback, string, isys, iutil, time
+ import signal, string, isys, iutil, time
from exception import handleException
import dispatch
import warnings
@@ -632,6 +641,9 @@ if __name__ == "__main__":
signal.signal(signal.SIGINT, signal.SIG_DFL)
signal.signal(signal.SIGSEGV, isys.handleSegv)
+ # add our own additional signal handlers
+ signal.signal(signal.SIGUSR2, lambda signum, frame: anaconda.dumpState())
+
setupEnvironment()
# we need to do this really early so we make sure its done before rpm
diff --git a/exception.py b/exception.py
index 28c0afb38..a53e60edb 100644
--- a/exception.py
+++ b/exception.py
@@ -71,7 +71,10 @@ class AnacondaExceptionDump:
lst.reverse()
lst.insert(0, "anaconda %s exception report\n" % os.getenv("ANACONDAVERSION"))
lst.insert(1, 'Traceback (most recent call first):\n')
- lst.extend(traceback.format_exception_only(self.type, self.value))
+
+ if self.type is not None and self.value is not None:
+ lst.extend(traceback.format_exception_only(self.type, self.value))
+
return joinfields(lst, "")
def format_stack(self):