summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2019-03-05 11:30:35 +0800
committerArmin Kuster <akuster808@gmail.com>2019-03-22 14:40:46 -0700
commitf9dac6e62623b0ac1a2b2f40b54337721afab7a5 (patch)
tree2721d5b6edc2e76bcf9f55309e8f9ed7c670cea1
parentab4483fbd95fecb951e765ebc7da918b503142ca (diff)
downloadopenembedded-core-f9dac6e62623b0ac1a2b2f40b54337721afab7a5.tar.gz
openembedded-core-f9dac6e62623b0ac1a2b2f40b54337721afab7a5.tar.bz2
openembedded-core-f9dac6e62623b0ac1a2b2f40b54337721afab7a5.zip
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> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-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):
def prepare_data(args):
# attempt to get the max_log_size from the server's settings
- max_log_size = getPayloadLimit("https://"+args.server+"/ClientPost/JSON")
+ max_log_size = getPayloadLimit(args.protocol+args.server+"/ClientPost/JSON")
if not os.path.isfile(args.error_file):
log.error("No data file found.")
@@ -132,9 +132,9 @@ def send_data(data, args):
headers={'Content-type': 'application/json', 'User-Agent': "send-error-report/"+version}
if args.json:
- url = "https://"+args.server+"/ClientPost/JSON/"
+ url = args.protocol+args.server+"/ClientPost/JSON/"
else:
- url = "https://"+args.server+"/ClientPost/"
+ url = args.protocol+args.server+"/ClientPost/"
req = urllib.request.Request(url, data=data, headers=headers)
try:
@@ -187,6 +187,11 @@ if __name__ == '__main__':
help="Return the result in json format, silences all other output",
action="store_true")
+ arg_parse.add_argument("--no-ssl",
+ help="Use http instead of https protocol",
+ dest="protocol",
+ action="store_const", const="http://", default="https://")
+
args = arg_parse.parse_args()