From a387a294cbc9cc59203e1c7ae0fadafd844c32b0 Mon Sep 17 00:00:00 2001 From: Jaeyoon Jung Date: Mon, 14 Apr 2025 11:41:11 +0900 Subject: [PATCH] send-error-report: Drop --no-ssl A server name from -s or --server flag needs to contain a leading string for URL scheme either http:// or https://. --no-ssl flag is dropped as it is no longer needed. (From OE-Core rev: fde39d4587d1a6f2390fa8f6f0e6771c5f145921) Signed-off-by: Jaeyoon Jung Signed-off-by: Richard Purdie --- scripts/send-error-report | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/scripts/send-error-report b/scripts/send-error-report index f8bf51a491..efb7e9630f 100755 --- a/scripts/send-error-report +++ b/scripts/send-error-report @@ -149,21 +149,16 @@ def send_data(data, args): print(response.read().decode('utf-8')) -def determine_server_url(args): +def validate_server_url(args): # Get the error report server from an argument - server = args.server or 'errors.yoctoproject.org' + server = args.server or 'https://errors.yoctoproject.org' - # The scheme contained in the given URL takes precedence over --no-ssl flag - scheme = args.protocol - if server.startswith('http://'): - server = server[len('http://'):] - scheme = 'http://' - elif server.startswith('https://'): - server = server[len('https://'):] - scheme = 'https://' + if not server.startswith('http://') and not server.startswith('https://'): + log.error("Missing a URL scheme either http:// or https:// in the server name: " + server) + sys.exit(1) # Construct the final URL - return f"{scheme}{server}" + return f"{server}" if __name__ == '__main__': @@ -206,14 +201,9 @@ 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() - args.server = determine_server_url(args) + args.server = validate_server_url(args) if (args.json == False): print("Preparing to send errors to: "+args.server)