sed_replace function in operations/utils calls sed with args in wrong order
See original GitHub issueDescribe the bug files.replace doesn’t work correctly because of sed arguments
To Reproduce any files.replace example
Expected behavior files.replace should work as advertised…
***** To FIX: change order of replace and line on line 58 of operations/util/files.py
Meta
-
Include output of
pyinfra --support
.System: Darwin Platform: Darwin-19.6.0-x86_64-i386-64bit Release: 19.6.0 Machine: x86_64 pyinfra: v1.0.4 Executable: /Users/x/.pyenv/versions/3.7.7/envs/infra-3.7.7/bin/pyinfra Python: 3.7.7 (CPython, Clang 11.0.3 (clang-1103.0.32.29))
-
How was pyinfra installed (source/pip)?
-
Include pyinfra-debug.log (if one was created)
-
Consider including output with
-vv
and--debug
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Substitution with sed + bash function
I still have a problem with this solution. The bash function is called. But the argument & seems not to be correctly copied...
Read more >sed with multiple expression for in-place argument
I can get the following output by using sed -i two times. ... When I tried the above code it takes s/item/stuff/g as...
Read more >Bash: trying to make a "sed-replace"-function, robust ...
Bash: trying to make a "sed-replace"-function, robust to arbitrary character input (expansion, substitution etc) Save this question.
Read more >Using sed for Find and Replace
sed reads input text from files or stdin, then edits the text line ... file or through arguments to the CLI command, then...
Read more >How to Use Sed to Find and Replace a String in a File
Read this guide to learn how to use the sed command to find and replace a all instances of a string in a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Github seems to have to have no private message capability so I’ll leave a comment here… Just wanted to thank you for the effort you have put into this project. I’m coming to it as an ansible ‘refugee’ and I love what you’ve done. No more YAML! I plan to keep using it and may be able to contribute if you find my code worthy…
So sorry for the confusion on my part… there is no bug. When using file.lines, replace is the value you want to replace what matched, not the line you are replacing…