mirror of https://github.com/ansible/ansible.git
display - Replace CRNL with NL (#85194)
parent
53b0f1645b
commit
e226294855
@ -0,0 +1,4 @@
|
|||||||
|
minor_changes:
|
||||||
|
- display - Replace Windows newlines (``\r\n``) in display output with Unix newlines (``\n``).
|
||||||
|
This ensures proper display of strings sourced from Windows hosts in environments which treat ``\r`` as ``\n``,
|
||||||
|
such as Azure Pipelines.
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
shippable/posix/group5
|
||||||
|
context/controller
|
||||||
|
gather_facts/no
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
m = AnsibleModule({})
|
||||||
|
m.warn("Hello\r\nNew\rAnsible\nWorld")
|
||||||
|
m.exit_json()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
- name: Run a command which generates a warning with NL, CR and CRNL
|
||||||
|
command: ansible -m noisy localhost
|
||||||
|
register: result
|
||||||
|
environment:
|
||||||
|
ANSIBLE_FORCE_COLOR: 0
|
||||||
|
ANSIBLE_LIBRARY: "{{ role_path }}/library"
|
||||||
|
|
||||||
|
- name: Verify NL and CR are preserved, but CRNL is converted to NL
|
||||||
|
assert:
|
||||||
|
that: result.stderr is contains 'Hello\nNew\rAnsible\nWorld'
|
||||||
Loading…
Reference in New Issue