-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
plugins: replace to_native(), to_text(), str() with str() where possible or leave it away in f-string formatting #9379
Conversation
…ave it away in f-string formatting.
If nobody objects, I'll merge this for the next release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of adjustments, couple of maybes
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Backport to stable-10: 💚 backport PR created✅ Backport PR branch: Backported as #9444 🤖 @patchback |
…ble or leave it away in f-string formatting (#9379) * Replace to_native(), to_text(), str() with str() where possible or leave it away in f-string formatting. * Improve formulation. Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> * Use more f-strings. * Remove unicode prefix for strings. --------- Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> (cherry picked from commit 2203560)
@russoz thanks for reviewing this! |
… to_text(), str() with str() where possible or leave it away in f-string formatting (#9444) plugins: replace to_native(), to_text(), str() with str() where possible or leave it away in f-string formatting (#9379) * Replace to_native(), to_text(), str() with str() where possible or leave it away in f-string formatting. * Improve formulation. Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> * Use more f-strings. * Remove unicode prefix for strings. --------- Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> (cherry picked from commit 2203560) Co-authored-by: Felix Fontein <felix@fontein.de>
…ble or leave it away in f-string formatting (ansible-collections#9379) * Replace to_native(), to_text(), str() with str() where possible or leave it away in f-string formatting. * Improve formulation. Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> * Use more f-strings. * Remove unicode prefix for strings. --------- Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
SUMMARY
With Python 3.6+
to_native()
andto_text()
are glorifiedstr()
calls assuming they are not potentially decoding byte strings to unicode strings. Remove them (in f-strings) or replace them withstr()
if possible.ISSUE TYPE
COMPONENT NAME
plugins/action/shutdown.py
plugins/cache/redis.py
plugins/callback/logentries.py
plugins/callback/slack.py
plugins/connection/chroot.py
plugins/filter/from_csv.py
plugins/filter/from_ini.py
plugins/filter/to_ini.py
plugins/inventory/cobbler.py
plugins/inventory/gitlab_runners.py
plugins/inventory/iocage.py
plugins/inventory/lxd.py
plugins/inventory/nmap.py
plugins/inventory/opennebula.py
plugins/inventory/proxmox.py
plugins/inventory/scaleway.py
plugins/inventory/virtualbox.py
plugins/lookup/cyberarkpassword.py
plugins/lookup/dig.py
plugins/lookup/dnstxt.py
plugins/lookup/etcd3.py
plugins/lookup/lmdb_kv.py
plugins/lookup/manifold.py
plugins/lookup/onepassword.py
plugins/lookup/tss.py