From f77c77ddad480905ea49630f12afa022382e434e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Thu, 4 Mar 2021 13:33:38 -0500 Subject: [PATCH] address pylint errors This commit addresses the three following pylint errors: - plugins/module_utils/cloud.py:145:27: isinstance-second-argument-not-valid-type: Second argument of isinstance is not a type - plugins/module_utils/cloudfront_facts.py:166:0: unnecessary-comprehension: Unnecessary use of a comprehension - plugins/module_utils/core.py:192:4: property-with-parameters: Cannot have defined parameters for properties --- plugins/module_utils/cloud.py | 2 +- plugins/module_utils/cloudfront_facts.py | 2 +- plugins/module_utils/core.py | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/module_utils/cloud.py b/plugins/module_utils/cloud.py index 8d5eeba305e..64a36fba6a6 100644 --- a/plugins/module_utils/cloud.py +++ b/plugins/module_utils/cloud.py @@ -142,7 +142,7 @@ def retry_func(*args, **kwargs): try: return f(*args, **kwargs) except Exception as e: - if isinstance(e, cls.base_class): + if cls.base_class and isinstance(e, cls.base_class): response_code = cls.status_code_from_exception(e) if cls.found(response_code, catch_extra_error_codes): msg = "{0}: Retrying in {1} seconds...".format(str(e), delay) diff --git a/plugins/module_utils/cloudfront_facts.py b/plugins/module_utils/cloudfront_facts.py index 994b84da63c..751f276f330 100644 --- a/plugins/module_utils/cloudfront_facts.py +++ b/plugins/module_utils/cloudfront_facts.py @@ -163,7 +163,7 @@ def summary_get_distribution_list(self, streaming=False): temp_distribution = {} for key_name in key_list: temp_distribution[key_name] = dist[key_name] - temp_distribution['Aliases'] = [alias for alias in dist['Aliases'].get('Items', [])] + temp_distribution['Aliases'] = dist['Aliases'].get('Items', []) temp_distribution['ETag'] = self.get_etag_from_distribution_id(dist['Id'], streaming) if not streaming: temp_distribution['WebACLId'] = dist['WebACLId'] diff --git a/plugins/module_utils/core.py b/plugins/module_utils/core.py index 349ec3b410d..b3072591e0c 100644 --- a/plugins/module_utils/core.py +++ b/plugins/module_utils/core.py @@ -188,7 +188,6 @@ def resource(self, service): return boto3_conn(self, conn_type='resource', resource=service, region=region, endpoint=ec2_url, **aws_connect_kwargs) - @property def region(self, boto3=True): return get_aws_region(self, boto3)