diff --git a/awx/api/views.py b/awx/api/views.py index 7a008de781..8b53bf872f 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -2238,6 +2238,7 @@ class UnifiedJobStdout(RetrieveAPIView): conv = Ansi2HTMLConverter(scheme=scheme, dark_bg=dark_bg, title=get_view_name(self.__class__)) content, start, end, absolute_end = unified_job.result_stdout_raw_limited(start_line, end_line) + content = UriCleaner.remove_sensitive(content) if content_only: headers = conv.produce_headers() body = conv.convert(content, full=False) # Escapes any HTML that may be in content. diff --git a/awx/main/redact.py b/awx/main/redact.py index 7ae051f054..1c196aead7 100644 --- a/awx/main/redact.py +++ b/awx/main/redact.py @@ -16,24 +16,17 @@ class UriCleaner(object): break o = urlparse.urlsplit(match.group(1)) if not o.username and not o.password: - flag_continue = False - if o.netloc: + if o.netloc and ":" in o.netloc: # Handle the special case url http://username:password that can appear in SCM url # on account of a bug? in ansible redaction - try: - (username, password) = o.netloc.split(':') - except ValueError as e: - flag_continue = True - pass - - if flag_continue: + (username, password) = o.netloc.split(':') + else: text_index += len(match.group(1)) continue else: username = o.username password = o.password - # Given a python MatchObject, with respect to redactedtext, find and # replace the first occurance of username and the first and second # occurance of password