[ABRT PATCH 2/3] Update python hook to use fixed socket interface

Denys Vlasenko dvlasenk at redhat.com
Thu Jun 20 14:37:19 UTC 2013


Make python hook use POST ionstead of PUT, send lowercased item
names (we might drop automatic lowercasing in the server later),
send "type" instead of "analyzer", and not send "basename"
pseudo-item (server will use type instead).

Signed-off-by: Denys Vlasenko <dvlasenk at redhat.com>
---
 src/hooks/abrt_exception_handler.py.in | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/hooks/abrt_exception_handler.py.in b/src/hooks/abrt_exception_handler.py.in
index 710ebdc..774a586 100644
--- a/src/hooks/abrt_exception_handler.py.in
+++ b/src/hooks/abrt_exception_handler.py.in
@@ -53,16 +53,15 @@ def write_dump(tb_text, tb):
         s.settimeout(5)
         try:
             s.connect(@VAR_RUN@ + "/abrt/abrt.socket")
-            s.sendall("PUT / HTTP/1.1\r\n\r\n")
-            s.sendall("PID=%s\0" % os.getpid())
-            s.sendall("EXECUTABLE=%s\0" % executable)
-            s.sendall("ANALYZER=Python\0")
-            s.sendall("BASENAME=pyhook\0")
+            s.sendall("POST / HTTP/1.1\r\n\r\n")
+            s.sendall("type=Python\0")
+            s.sendall("pid=%s\0" % os.getpid())
+            s.sendall("executable=%s\0" % executable)
             # This handler puts a short(er) crash descr in 1st line of the backtrace.
             # Example:
             # CCMainWindow.py:1:<module>:ZeroDivisionError: integer division or modulo by zero
-            s.sendall("REASON=%s\0" % tb_text.splitlines()[0])
-            s.sendall("BACKTRACE=%s\0" % tb_text)
+            s.sendall("reason=%s\0" % tb_text.splitlines()[0])
+            s.sendall("backtrace=%s\0" % tb_text)
 
             if dso_list:
                 s.sendall("dso_list=%s\0" % "\n".join(dso_list))
-- 
1.8.1.4



More information about the Crash-catcher mailing list