summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-29 14:32:15 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-29 15:36:52 +0000
commite2cffc00e1ea1b2d8bd5143f4d8ff56501b7e3f7 (patch)
tree435ea748f866763ad5fe39aa1c69738aad485720 /scripts
parent3f15d8a807edb02825e32c4d8c924b4465ca5098 (diff)
downloadpoky-e2cffc00e1ea1b2d8bd5143f4d8ff56501b7e3f7.tar.gz
scripts/send-error-report: Set exit code if error occurs
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] (From OE-Core rev: b219377defc9517af360986352bd7da1a7906f10) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/send-error-report6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/send-error-report b/scripts/send-error-report
index c99d3876d7..01c292ead1 100755
--- a/scripts/send-error-report
+++ b/scripts/send-error-report
@@ -62,6 +62,7 @@ def sendData(json_file, server):
62 g.write(email + "\n") 62 g.write(email + "\n")
63 else: 63 else:
64 print("Invalid inputs, try again.") 64 print("Invalid inputs, try again.")
65 sys.exit(1)
65 return 66 return
66 67
67 with open(json_file) as f: 68 with open(json_file) as f:
@@ -74,6 +75,7 @@ def sendData(json_file, server):
74 data = json.dumps(jsondata, indent=4, sort_keys=True) 75 data = json.dumps(jsondata, indent=4, sort_keys=True)
75 except: 76 except:
76 print("Invalid json data") 77 print("Invalid json data")
78 sys.exit(1)
77 return 79 return
78 80
79 try: 81 try:
@@ -87,12 +89,14 @@ def sendData(json_file, server):
87 print("There was a problem submiting your data, response written in %s.response.html" % json_file) 89 print("There was a problem submiting your data, response written in %s.response.html" % json_file)
88 with open("%s.response.html" % json_file, "w") as f: 90 with open("%s.response.html" % json_file, "w") as f:
89 f.write(res) 91 f.write(res)
92 sys.exit(1)
90 conn.close() 93 conn.close()
91 except Exception as e: 94 except Exception as e:
92 print("Server connection failed: %s" % e) 95 print("Server connection failed: %s" % e)
93 96 sys.exit(1)
94 else: 97 else:
95 print("No data file found.") 98 print("No data file found.")
99 sys.exit(1)
96 100
97 101
98if __name__ == '__main__': 102if __name__ == '__main__':