1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-29 06:58:55 +00:00

modules [t-z]*: use f-strings (#10978)

* modules [t-z]*: use f-strings

* add changelog frag

* remove extraneous file
This commit is contained in:
Alexei Znamensky 2025-10-26 22:36:03 +13:00 committed by GitHub
parent af246f8de3
commit adcc683da7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 514 additions and 536 deletions

View file

@ -114,8 +114,7 @@ from ansible.module_utils.urls import fetch_url
def post_twilio_api(module, account_sid, auth_token, msg, from_number,
to_number, media_url=None):
URI = "https://api.twilio.com/2010-04-01/Accounts/%s/Messages.json" \
% (account_sid,)
URI = f"https://api.twilio.com/2010-04-01/Accounts/{account_sid}/Messages.json"
AGENT = "Ansible"
data = {'From': from_number, 'To': to_number, 'Body': msg}
@ -168,7 +167,7 @@ def main():
if 'body' in info:
body = module.from_json(info['body'])
body_message = body['message']
module.fail_json(msg="unable to send message to %s: %s" % (number, body_message))
module.fail_json(msg=f"unable to send message to {number}: {body_message}")
module.exit_json(msg=msg, changed=False)