summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2019-03-05 11:30:35 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-03-06 10:39:25 +0000
commit7f77f9292930c6b3cc5ae2a67bdb48e53827f2fe (patch)
treec318c56a562bc651c8cca2368f27db9a7db6fe73 /scripts
parent4e2c4018e03e8498efce9b826551c2fdb373e16d (diff)
downloadpoky-7f77f9292930c6b3cc5ae2a67bdb48e53827f2fe.tar.gz
send-error-report: Add --no-ssl to use http protocol
The script use https protocol by default, but the error-report-web server's https connection may not work (e.g., doesn't work with python 2.7.6), so add an option --no-ssl to make it use http. (From OE-Core rev: a4c89902a24c0961657c8281425d480097aadfa6) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/send-error-report11
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/send-error-report b/scripts/send-error-report
index 3528cf93a9..0ed7cc905e 100755
--- a/scripts/send-error-report
+++ b/scripts/send-error-report
@@ -62,7 +62,7 @@ def edit_content(json_file_path):
62 62
63def prepare_data(args): 63def prepare_data(args):
64 # attempt to get the max_log_size from the server's settings 64 # attempt to get the max_log_size from the server's settings
65 max_log_size = getPayloadLimit("https://"+args.server+"/ClientPost/JSON") 65 max_log_size = getPayloadLimit(args.protocol+args.server+"/ClientPost/JSON")
66 66
67 if not os.path.isfile(args.error_file): 67 if not os.path.isfile(args.error_file):
68 log.error("No data file found.") 68 log.error("No data file found.")
@@ -132,9 +132,9 @@ def send_data(data, args):
132 headers={'Content-type': 'application/json', 'User-Agent': "send-error-report/"+version} 132 headers={'Content-type': 'application/json', 'User-Agent': "send-error-report/"+version}
133 133
134 if args.json: 134 if args.json:
135 url = "https://"+args.server+"/ClientPost/JSON/" 135 url = args.protocol+args.server+"/ClientPost/JSON/"
136 else: 136 else:
137 url = "https://"+args.server+"/ClientPost/" 137 url = args.protocol+args.server+"/ClientPost/"
138 138
139 req = urllib.request.Request(url, data=data, headers=headers) 139 req = urllib.request.Request(url, data=data, headers=headers)
140 try: 140 try:
@@ -187,6 +187,11 @@ if __name__ == '__main__':
187 help="Return the result in json format, silences all other output", 187 help="Return the result in json format, silences all other output",
188 action="store_true") 188 action="store_true")
189 189
190 arg_parse.add_argument("--no-ssl",
191 help="Use http instead of https protocol",
192 dest="protocol",
193 action="store_const", const="http://", default="https://")
194
190 195
191 196
192 args = arg_parse.parse_args() 197 args = arg_parse.parse_args()