mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -03:30
Make sure stdout always lines up with what is expected out ansible
Also, strip superflous extra newlines at the end of job events, this helps downloaded stdout line up.
This commit is contained in:
parent
e6dcf1f61a
commit
0139bccde3
@ -818,7 +818,7 @@ class OutputEventFilter(object):
|
||||
for stdout_chunk in stdout_chunks:
|
||||
event_data['counter'] = self._counter
|
||||
self._counter += 1
|
||||
event_data['stdout'] = stdout_chunk
|
||||
event_data['stdout'] = stdout_chunk[:-2] if len(stdout_chunk) > 2 else ""
|
||||
n_lines = stdout_chunk.count('\n')
|
||||
event_data['start_line'] = self._start_line
|
||||
event_data['end_line'] = self._start_line + n_lines
|
||||
|
||||
@ -215,7 +215,7 @@ export default ['$log', 'moment', function($log, moment){
|
||||
let padBy = lineNums.length - lines.length;
|
||||
|
||||
for (let i = 0; i <= padBy; i++) {
|
||||
lines.push("[1;imLine capped.[0m");
|
||||
lines.push("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -129,7 +129,7 @@ describe('parseStdoutService', () => {
|
||||
end_line: 11,
|
||||
stdout: "a\r\nb\r\nc..."
|
||||
};
|
||||
let expectedReturn = [[8, "a"],[9, "b"], [10,"c..."], [11, "[1;imLine capped.[0m"]];
|
||||
let expectedReturn = [[8, "a"],[9, "b"], [10,"c..."], [11, ""]];
|
||||
|
||||
let returnedEvent = parseStdoutService.getLineArr(mockEvent);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user