mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-28 10:51:49 -05:00
Simplify hostname parsing
This commit is contained in:
@@ -47,11 +47,10 @@ def construct_rsyslog_conf_template(settings=settings):
|
||||
return tmpl
|
||||
|
||||
if protocol.startswith('http'):
|
||||
scheme = 'https'
|
||||
# urlparse requires '//' to be provided if scheme is not specified
|
||||
original_parsed = urlparse.urlsplit(host)
|
||||
if (not original_parsed.scheme and not host.startswith('//')) or original_parsed.hostname is None:
|
||||
host = '%s://%s' % (scheme, host)
|
||||
host = 'https://%s' % (host)
|
||||
parsed = urlparse.urlsplit(host)
|
||||
|
||||
host = escape_quotes(parsed.hostname)
|
||||
|
||||
Reference in New Issue
Block a user