From e179c1d4e03f2fec1755093097dbde69760f4751 Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Mon, 8 May 2023 19:21:22 +0200 Subject: [PATCH] Bulk migration to Python 3.6 f-strings (#1810) 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: https://github.com/ansible-collections/community.aws/commit/de338210dc1b0bb2eecee1dc16e073163b2d1df7 --- plugins/modules/ec2_transit_gateway.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/modules/ec2_transit_gateway.py b/plugins/modules/ec2_transit_gateway.py index 8c6282d0b0f..9b50cb21b9c 100644 --- a/plugins/modules/ec2_transit_gateway.py +++ b/plugins/modules/ec2_transit_gateway.py @@ -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"]) @@ -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 @@ -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