1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-02-04 07:51:50 +00:00

modules bc*: use f-strings (#10945)

* modules bc*: use f-strings

* no quotes or backticks inside f-strs

* add changelog frag

* rename chglof frag file

* rename chglof frag file

* copr: re-applied change maintain original logic
This commit is contained in:
Alexei Znamensky 2025-10-25 12:45:40 +13:00 committed by GitHub
parent f9b4abf930
commit 0ef2235929
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 197 additions and 202 deletions

View file

@ -153,7 +153,7 @@ def get_existing_deploy_key(module, bitbucket):
module.fail_json(msg=error_messages['required_permission'])
if info['status'] != 200:
module.fail_json(msg='Failed to retrieve the list of deploy keys: {0}'.format(info))
module.fail_json(msg=f'Failed to retrieve the list of deploy keys: {info}')
res = next((v for v in content['values'] if v['label'] == module.params['label']), None)
@ -186,10 +186,7 @@ def create_deploy_key(module, bitbucket):
module.fail_json(msg=error_messages['invalid_key'])
if info['status'] != 200:
module.fail_json(msg='Failed to create deploy key `{label}`: {info}'.format(
label=module.params['label'],
info=info,
))
module.fail_json(msg=f"Failed to create deploy key `{module.params['label']}`: {info}")
def delete_deploy_key(module, bitbucket, key_id):
@ -209,10 +206,7 @@ def delete_deploy_key(module, bitbucket, key_id):
module.fail_json(msg=error_messages['required_permission'])
if info['status'] != 204:
module.fail_json(msg='Failed to delete deploy key `{label}`: {info}'.format(
label=module.params['label'],
info=info,
))
module.fail_json(msg=f"Failed to delete deploy key `{module.params['label']}`: {info}")
def main():