Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] scripts/send-error-report: Set exit code if error occurs
@ 2015-01-29 14:32 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2015-01-29 14:32 UTC (permalink / raw)
  To: openembedded-core

If an error occurs, set an error exit code so the world knows about it. This fixes
issues where the autobuilder doesn't notice these failures.

[YOCTO #7265]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/scripts/send-error-report b/scripts/send-error-report
index c99d387..01c292e 100755
--- a/scripts/send-error-report
+++ b/scripts/send-error-report
@@ -62,6 +62,7 @@ def sendData(json_file, server):
                     g.write(email + "\n")
             else:
                 print("Invalid inputs, try again.")
+                sys.exit(1)
                 return
 
         with open(json_file) as f:
@@ -74,6 +75,7 @@ def sendData(json_file, server):
             data = json.dumps(jsondata, indent=4, sort_keys=True)
         except:
             print("Invalid json data")
+            sys.exit(1)
             return
 
         try:
@@ -87,12 +89,14 @@ def sendData(json_file, server):
                 print("There was a problem submiting your data, response written in %s.response.html" % json_file)
                 with open("%s.response.html" % json_file, "w") as f:
                     f.write(res)
+                sys.exit(1)
             conn.close()
         except Exception as e:
                 print("Server connection failed: %s" % e)
-
+                sys.exit(1)
     else:
         print("No data file found.")
+        sys.exit(1)
 
 
 if __name__ == '__main__':




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-01-29 14:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-29 14:32 [PATCH] scripts/send-error-report: Set exit code if error occurs Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox