summaryrefslogtreecommitdiffstats
path: root/scripts/send-error-report
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-02-11 17:40:10 +0000
commit83767cbe903e230ac687b835cb1e5cb6377797e9 (patch)
treee52a13310a862593a83d59b5bebb33bb9c660912 /scripts/send-error-report
parent8b3b21494f846e17c8865e33af5e67118607b4b3 (diff)
downloadpoky-83767cbe903e230ac687b835cb1e5cb6377797e9.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) (From OE-Core rev: 88b9a9dd491d6803a72c497cf674434da14704b7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/send-error-report')
-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__':