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:
parent
749c06cd01
commit
d51e4c188b
22 changed files with 153 additions and 155 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue