Use utf-8 & properly parse hostname from registry URL

This commit is contained in:
Christian M. Adams
2021-05-20 11:47:52 -04:00
parent 8316a1d198
commit cea6d8c3cb
3 changed files with 23 additions and 14 deletions

View File

@@ -51,7 +51,7 @@ def construct_rsyslog_conf_template(settings=settings):
# 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) if scheme else '//%s' % host
host = '%s://%s' % (scheme, host)
parsed = urlparse.urlsplit(host)
host = escape_quotes(parsed.hostname)