1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-22 19:59:07 +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

@ -88,7 +88,6 @@ import traceback
from urllib.parse import urlencode
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.text.converters import to_native
from ansible.module_utils.urls import fetch_url
@ -132,12 +131,12 @@ def main():
data = urlencode(params)
response, info = fetch_url(module, url, data=data, method='POST')
except Exception as e:
module.fail_json(msg='Unable to notify Rollbar: %s' % to_native(e), exception=traceback.format_exc())
module.fail_json(msg=f'Unable to notify Rollbar: {e}', exception=traceback.format_exc())
else:
if info['status'] == 200:
module.exit_json(changed=True)
else:
module.fail_json(msg='HTTP result code: %d connecting to %s' % (info['status'], url))
module.fail_json(msg=f"HTTP result code: {info['status']} connecting to {url}")
if __name__ == '__main__':