mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-19 11:20:22 -07:00
callback plugins: use f-strings (#9321)
* callback plugins: use f-strings * add changelog frag * manual change for few occurrences * manual change for few occurrences * adjustment from review * adjustment from review * adjustment from review * Update plugins/callback/splunk.py Co-authored-by: Felix Fontein <felix@fontein.de> * replace str templating with JSON templating --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
6e84c1375e
commit
c3ed2144e2
22 changed files with 251 additions and 253 deletions
|
@ -85,7 +85,7 @@ def banner(self, msg, color=None, cows=True):
|
|||
msg = to_text(msg)
|
||||
if self.b_cowsay and cows:
|
||||
try:
|
||||
self.banner_cowsay("%s @ %s" % (msg, timestamp))
|
||||
self.banner_cowsay(f"{msg} @ {timestamp}")
|
||||
return
|
||||
except OSError:
|
||||
self.warning("somebody cleverly deleted cowsay or something during the PB run. heh.")
|
||||
|
@ -98,7 +98,7 @@ def banner(self, msg, color=None, cows=True):
|
|||
if star_len <= 3:
|
||||
star_len = 3
|
||||
stars = "*" * star_len
|
||||
self.display("\n%s %s %s" % (msg, stars, timestamp), color=color)
|
||||
self.display(f"\n{msg} {stars} {timestamp}", color=color)
|
||||
|
||||
|
||||
class CallbackModule(Default):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue