mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-05 05:04:44 +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'))
|
||||
|
||||
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user