1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-05-02 00:12:54 +00:00

modules r*: use f-strings (#10975)

* modules r*: use f-strings

* add changelog frag

* Apply suggestions from code review
This commit is contained in:
Alexei Znamensky 2025-10-26 19:48:33 +13:00 committed by GitHub
parent 749c06cd01
commit d51e4c188b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 153 additions and 155 deletions

View file

@ -93,16 +93,15 @@ def main():
try:
value = redis.connection.get(key)
except Exception as e:
msg = 'Failed to get value of key "{0}" with exception: {1}'.format(
key, str(e))
msg = f'Failed to get value of key "{key}" with exception: {e}'
result['msg'] = msg
module.fail_json(**result)
if value is None:
msg = 'Key "{0}" does not exist in database'.format(key)
msg = f'Key "{key}" does not exist in database'
result['exists'] = False
else:
msg = 'Got key "{0}"'.format(key)
msg = f'Got key "{key}"'
result['value'] = value
result['exists'] = True
result['msg'] = msg