mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00
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>
This commit is contained in:
parent
4edf8615a6
commit
a387a294cb
|
@ -149,21 +149,16 @@ def send_data(data, args):
|
||||||
print(response.read().decode('utf-8'))
|
print(response.read().decode('utf-8'))
|
||||||
|
|
||||||
|
|
||||||
def determine_server_url(args):
|
def validate_server_url(args):
|
||||||
# Get the error report server from an argument
|
# 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
|
if not server.startswith('http://') and not server.startswith('https://'):
|
||||||
scheme = args.protocol
|
log.error("Missing a URL scheme either http:// or https:// in the server name: " + server)
|
||||||
if server.startswith('http://'):
|
sys.exit(1)
|
||||||
server = server[len('http://'):]
|
|
||||||
scheme = 'http://'
|
|
||||||
elif server.startswith('https://'):
|
|
||||||
server = server[len('https://'):]
|
|
||||||
scheme = 'https://'
|
|
||||||
|
|
||||||
# Construct the final URL
|
# Construct the final URL
|
||||||
return f"{scheme}{server}"
|
return f"{server}"
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -206,14 +201,9 @@ if __name__ == '__main__':
|
||||||
help="Return the result in json format, silences all other output",
|
help="Return the result in json format, silences all other output",
|
||||||
action="store_true")
|
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 = arg_parse.parse_args()
|
||||||
|
|
||||||
args.server = determine_server_url(args)
|
args.server = validate_server_url(args)
|
||||||
|
|
||||||
if (args.json == False):
|
if (args.json == False):
|
||||||
print("Preparing to send errors to: "+args.server)
|
print("Preparing to send errors to: "+args.server)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user