mirror of
https://github.com/ansible/awx.git
synced 2026-01-24 16:01:20 -03:30
fix use before declare and added a missed redact
This commit is contained in:
parent
8bb8f67370
commit
ee9ae8bb00
@ -2238,6 +2238,7 @@ class UnifiedJobStdout(RetrieveAPIView):
|
|||||||
conv = Ansi2HTMLConverter(scheme=scheme, dark_bg=dark_bg,
|
conv = Ansi2HTMLConverter(scheme=scheme, dark_bg=dark_bg,
|
||||||
title=get_view_name(self.__class__))
|
title=get_view_name(self.__class__))
|
||||||
content, start, end, absolute_end = unified_job.result_stdout_raw_limited(start_line, end_line)
|
content, start, end, absolute_end = unified_job.result_stdout_raw_limited(start_line, end_line)
|
||||||
|
content = UriCleaner.remove_sensitive(content)
|
||||||
if content_only:
|
if content_only:
|
||||||
headers = conv.produce_headers()
|
headers = conv.produce_headers()
|
||||||
body = conv.convert(content, full=False) # Escapes any HTML that may be in content.
|
body = conv.convert(content, full=False) # Escapes any HTML that may be in content.
|
||||||
|
|||||||
@ -16,24 +16,17 @@ class UriCleaner(object):
|
|||||||
break
|
break
|
||||||
o = urlparse.urlsplit(match.group(1))
|
o = urlparse.urlsplit(match.group(1))
|
||||||
if not o.username and not o.password:
|
if not o.username and not o.password:
|
||||||
flag_continue = False
|
if o.netloc and ":" in o.netloc:
|
||||||
if o.netloc:
|
|
||||||
# Handle the special case url http://username:password that can appear in SCM url
|
# Handle the special case url http://username:password that can appear in SCM url
|
||||||
# on account of a bug? in ansible redaction
|
# on account of a bug? in ansible redaction
|
||||||
try:
|
(username, password) = o.netloc.split(':')
|
||||||
(username, password) = o.netloc.split(':')
|
else:
|
||||||
except ValueError as e:
|
|
||||||
flag_continue = True
|
|
||||||
pass
|
|
||||||
|
|
||||||
if flag_continue:
|
|
||||||
text_index += len(match.group(1))
|
text_index += len(match.group(1))
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
username = o.username
|
username = o.username
|
||||||
password = o.password
|
password = o.password
|
||||||
|
|
||||||
|
|
||||||
# Given a python MatchObject, with respect to redactedtext, find and
|
# Given a python MatchObject, with respect to redactedtext, find and
|
||||||
# replace the first occurance of username and the first and second
|
# replace the first occurance of username and the first and second
|
||||||
# occurance of password
|
# occurance of password
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user