mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 06:10: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
|
@ -73,7 +73,7 @@ except ImportError:
|
|||
|
||||
# Getting MAC Address of system:
|
||||
def get_mac():
|
||||
mac = "%012x" % getnode()
|
||||
mac = f"{getnode():012x}"
|
||||
return ":".join(map(lambda index: mac[index:index + 2], range(int(len(mac) / 2))))
|
||||
|
||||
|
||||
|
@ -161,7 +161,7 @@ class CallbackModule(CallbackBase):
|
|||
if ninvalidKeys > 0:
|
||||
for key in invalidKeys:
|
||||
del meta[key]
|
||||
meta['__errors'] = 'These keys have been sanitized: ' + ', '.join(invalidKeys)
|
||||
meta['__errors'] = f"These keys have been sanitized: {', '.join(invalidKeys)}"
|
||||
return meta
|
||||
|
||||
def sanitizeJSON(self, data):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue