diff --git a/plugins/inventory/aws_ec2.py b/plugins/inventory/aws_ec2.py index e80707a57ad..f97ed9c3f9e 100644 --- a/plugins/inventory/aws_ec2.py +++ b/plugins/inventory/aws_ec2.py @@ -340,7 +340,7 @@ def _compile_values(self, obj, attr): else: temp_obj = obj.get(attr) - has_indexes = any([isinstance(temp_obj, list), isinstance(temp_obj, tuple)]) + has_indexes = any(isinstance(temp_obj, list), isinstance(temp_obj, tuple)) if has_indexes and len(temp_obj) == 1: return temp_obj[0] @@ -470,7 +470,7 @@ def _get_instances_by_region(self, regions, filters, strict_permissions): for connection, region in self._boto3_conn(regions): try: # By default find non-terminated/terminating instances - if not any([f['Name'] == 'instance-state-name' for f in filters]): + if not any(f['Name'] == 'instance-state-name' for f in filters): filters.append({'Name': 'instance-state-name', 'Values': ['running', 'pending', 'stopping', 'stopped']}) paginator = connection.get_paginator('describe_instances') reservations = paginator.paginate(Filters=filters).build_full_result().get('Reservations') diff --git a/plugins/modules/ec2_group.py b/plugins/modules/ec2_group.py index 0d122a76b2e..43907d4d7ee 100644 --- a/plugins/modules/ec2_group.py +++ b/plugins/modules/ec2_group.py @@ -1316,7 +1316,7 @@ def main(): if purge_rules: revoke_ingress = [] for p in present_ingress: - if not any([rule_cmp(p, b) for b in named_tuple_ingress_list]): + if not any(rule_cmp(p, b) for b in named_tuple_ingress_list): revoke_ingress.append(to_permission(p)) else: revoke_ingress = [] @@ -1329,7 +1329,7 @@ def main(): else: revoke_egress = [] for p in present_egress: - if not any([rule_cmp(p, b) for b in named_tuple_egress_list]): + if not any(rule_cmp(p, b) for b in named_tuple_egress_list): revoke_egress.append(to_permission(p)) else: revoke_egress = [] diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index d9ce76803b2..31a4d4c9c6d 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -1,5 +1,3 @@ -plugins/inventory/aws_ec2.py pylint:use-a-generator # (new test) Should be an easy fix but not worth blocking gating -plugins/modules/ec2_group.py pylint:use-a-generator # (new test) Should be an easy fix but not worth blocking gating plugins/modules/ec2_tag.py validate-modules:parameter-state-invalid-choice # Deprecated choice that can't be removed until 2022 plugins/modules/ec2_vol.py validate-modules:parameter-state-invalid-choice # Deprecated choice that can't be removed until 2022 plugins/module_utils/compat/_ipaddress.py no-assert # Vendored library