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:
parent
af246f8de3
commit
adcc683da7
45 changed files with 514 additions and 536 deletions
|
|
@ -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'],
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue