diff options
| author | Jaeyoon Jung <jaeyoon.jung@lge.com> | 2025-04-14 11:41:11 +0900 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-04-17 11:03:22 +0100 |
| commit | a387a294cbc9cc59203e1c7ae0fadafd844c32b0 (patch) | |
| tree | c853b276231615277d0b35d9abe363f75aa71295 /scripts/send-error-report | |
| parent | 4edf8615a68949b87dde6c90f5602a1127d6c2d7 (diff) | |
| download | poky-a387a294cbc9cc59203e1c7ae0fadafd844c32b0.tar.gz | |
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 <jaeyoon.jung@lge.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/send-error-report')
| -rwxr-xr-x | scripts/send-error-report | 24 |
1 files 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): | |||
| 149 | print(response.read().decode('utf-8')) | 149 | print(response.read().decode('utf-8')) |
| 150 | 150 | ||
| 151 | 151 | ||
| 152 | def determine_server_url(args): | 152 | def validate_server_url(args): |
| 153 | # Get the error report server from an argument | 153 | # Get the error report server from an argument |
| 154 | server = args.server or 'errors.yoctoproject.org' | 154 | server = args.server or 'https://errors.yoctoproject.org' |
| 155 | 155 | ||
| 156 | # The scheme contained in the given URL takes precedence over --no-ssl flag | 156 | if not server.startswith('http://') and not server.startswith('https://'): |
| 157 | scheme = args.protocol | 157 | log.error("Missing a URL scheme either http:// or https:// in the server name: " + server) |
| 158 | if server.startswith('http://'): | 158 | sys.exit(1) |
| 159 | server = server[len('http://'):] | ||
| 160 | scheme = 'http://' | ||
| 161 | elif server.startswith('https://'): | ||
| 162 | server = server[len('https://'):] | ||
| 163 | scheme = 'https://' | ||
| 164 | 159 | ||
| 165 | # Construct the final URL | 160 | # Construct the final URL |
| 166 | return f"{scheme}{server}" | 161 | return f"{server}" |
| 167 | 162 | ||
| 168 | 163 | ||
| 169 | if __name__ == '__main__': | 164 | if __name__ == '__main__': |
| @@ -206,14 +201,9 @@ if __name__ == '__main__': | |||
| 206 | help="Return the result in json format, silences all other output", | 201 | help="Return the result in json format, silences all other output", |
| 207 | action="store_true") | 202 | action="store_true") |
| 208 | 203 | ||
| 209 | arg_parse.add_argument("--no-ssl", | ||
| 210 | help="Use http instead of https protocol", | ||
| 211 | dest="protocol", | ||
| 212 | action="store_const", const="http://", default="https://") | ||
| 213 | |||
| 214 | args = arg_parse.parse_args() | 204 | args = arg_parse.parse_args() |
| 215 | 205 | ||
| 216 | args.server = determine_server_url(args) | 206 | args.server = validate_server_url(args) |
| 217 | 207 | ||
| 218 | if (args.json == False): | 208 | if (args.json == False): |
| 219 | print("Preparing to send errors to: "+args.server) | 209 | print("Preparing to send errors to: "+args.server) |
