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

@ -112,7 +112,7 @@ def main():
if api_args['parse_mode'] == 'plain':
del api_args['parse_mode']
url = 'https://api.telegram.org/bot{token}/{api_method}'.format(token=token, api_method=api_method)
url = f'https://api.telegram.org/bot{token}/{api_method}'
if module.check_mode:
module.exit_json(changed=False)
@ -127,11 +127,7 @@ def main():
else:
body = json.loads(info['body'])
module.fail_json(
msg="Failed to send message, return status = {status}\n"
"url = {api_url}\n"
"api_args = {api_args}".format(
status=info['status'], api_url=url, api_args=api_args
),
msg=f"Failed to send message, return status = {info['status']}\nurl = {url}\napi_args = {api_args}",
telegram_error=body['description'],
)