New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
win_lineinfile: windows paths have \r and \n stripped #33858
Comments
Files identified in the description: If these files are inaccurate, please update the |
Files identified in the description: If these files are inaccurate, please update the |
Files identified in the description: If these files are inaccurate, please update the |
I think there are two ways of approaching this.
ansible/lib/ansible/modules/windows/win_lineinfile.ps1 Lines 347 to 352 in e76e8ae
In addition, lines 350-351 don't make sense as they are converting what is an attempt to escape the line break and print it literally, into a line break. I can't see a good reason for doing this conversion. I'll bring it up in the WWG today. |
* win_lineinfile: fix ansible#33858. Removed conversion from \r\n * win_lineinfile: added test for ansible#33858 * win_lineinfile: added documentation and more tests for change * win_lineinfile: fixed wrong hash in testing (cherry picked from commit e15a903)
* Win lineinfile fix (#35100) * win_lineinfile: fix #33858. Removed conversion from \r\n * win_lineinfile: added test for #33858 * win_lineinfile: added documentation and more tests for change * win_lineinfile: fixed wrong hash in testing (cherry picked from commit e15a903) * Added changelog for win_lineinfile fix * fix typo in changelog
ISSUE TYPE
Bug Report
COMPONENT NAME
win_lineinfile
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
SUMMARY
this:
ansible/lib/ansible/modules/windows/win_lineinfile.ps1
Line 348 in e76e8ae
butchers any windows path and also makes regexes fail and destroys idempotency
STEPS TO REPRODUCE
use win_lineinefile to add a windows path containing \r or \n
OR
EXPECTED RESULTS
file C:\temp\testfile.tx contains C:\path\returning\from\nowhere
ACTUAL RESULTS
file C:\temp\testfile.tx contains C:\patheturning\fromowhere
Current workaround is to use forward slashes, but that requires forward slash compatibility in any program that uses this file
The text was updated successfully, but these errors were encountered: