Skip to content

Commit

Permalink
Bulk migration to Python 3.6 f-strings (ansible-collections#1810)
Browse files Browse the repository at this point in the history
Bulk migration to Python 3.6 f-strings

SUMMARY
We've dropped support for Python <3.6, bulk migrate to fstrings and perform some general string cleanup
A combination of

black --preview
flynt
some manual cleanup

ISSUE TYPE

Feature Pull Request

COMPONENT NAME
plugins/
tests/
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@de33821
  • Loading branch information
tremble authored and mandar242 committed Oct 23, 2024
1 parent 61ecc7d commit e179c1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/modules/ec2_transit_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def get_matching_tgw(self, tgw_id, description=None, skip_deleted=True):

if len(tgws) > 1:
self._module.fail_json(
msg="EC2 returned more than one transit Gateway for description {0}, aborting".format(description)
msg=f"EC2 returned more than one transit Gateway for description {description}, aborting"
)
elif tgws:
tgw = camel_dict_to_snake_dict(tgws[0], ignore_list=["Tags"])
Expand Down Expand Up @@ -375,7 +375,7 @@ def create_tgw(self, description):
else:
result = self.get_matching_tgw(tgw_id=tgw_id)

self._results["msg"] = " Transit gateway {0} created".format(result["transit_gateway_id"])
self._results["msg"] = f" Transit gateway {result['transit_gateway_id']} created"

return result

Expand All @@ -401,7 +401,7 @@ def delete_tgw(self, tgw_id):
else:
result = self.get_matching_tgw(tgw_id=tgw_id, skip_deleted=False)

self._results["msg"] = " Transit gateway {0} deleted".format(tgw_id)
self._results["msg"] = f" Transit gateway {tgw_id} deleted"

return result

Expand Down

0 comments on commit e179c1d

Please sign in to comment.