[OE-core] [PATCH 1/2] report-error: sending error report to server without user intervention

João Henrique Ferreira de Freitas joaohf at gmail.com
Wed Nov 12 23:08:38 UTC 2014


If ERR_REPORT_SERVER is set to a server which has a running instance of
Error Reporting Tool, then that server will be used to send error
reports.

Signed-off-by: João Henrique Ferreira de Freitas <joaohf at gmail.com>
---
 meta/classes/report-error.bbclass | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/meta/classes/report-error.bbclass b/meta/classes/report-error.bbclass
index 5fe2355..f9e821f 100644
--- a/meta/classes/report-error.bbclass
+++ b/meta/classes/report-error.bbclass
@@ -7,6 +7,7 @@
 # Licensed under the MIT license, see COPYING.MIT for details
 
 ERR_REPORT_DIR ?= "${LOG_DIR}/error-report"
+ERR_REPORT_SERVER ?= ""
 
 def errorreport_getdata(e):
     logpath = e.data.getVar('ERR_REPORT_DIR', True)
@@ -24,6 +25,16 @@ def errorreport_savedata(e, newdata, file):
         json.dump(newdata, f, indent=4, sort_keys=True)
     return datafile
 
+def errorreport_senddata(e, datafile):
+    import subprocess
+    server = e.data.getVar('ERR_REPORT_SERVER', True)
+    if server:
+        cmd = 'send-error-report %s %s' % (datafile, server)
+        subprocess.call(cmd, shell=True)
+    else:
+        bb.note("The errors for this build are stored in %s\nYou can send the errors to an upstream server by running:\n  send-error-report %s [server]" % (datafile, datafile))
+        bb.note("The contents of these logs will be posted in public if you use the above command with the default server. If you need to do so, please ensure you remove any identifying or proprietary information before sending.")
+    
 python errorreport_handler () {
         import json
 
-- 
1.9.1




More information about the Openembedded-core mailing list