Skip to content

Commit

Permalink
Minor linting fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Aug 10, 2022
1 parent 898ade5 commit a8c50b2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions plugins/module_utils/acm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
# on behalf of Telstra Corporation Limited
#
# Common functionality to be used by the modules:
# - acm
# - acm_certificate
# - acm_certificate_info

from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
Expand Down Expand Up @@ -213,7 +214,7 @@ def import_certificate(self, client, module, certificate, private_key, arn=None,
module.debug("Attempting to delete the cert we just created, arn=%s" % arn)
try:
self.delete_certificate_with_backoff(client, arn)
except Exception as f:
except Exception:
module.warn("Certificate %s exists, and is not tagged. So Ansible will not see it on the next run.")
module.fail_json_aws(e, msg="Couldn't tag certificate %s, couldn't delete it either" % arn)
module.fail_json_aws(e, msg="Couldn't tag certificate %s" % arn)
Expand Down
4 changes: 2 additions & 2 deletions plugins/module_utils/botocore.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def boto3_conn(module, conn_type=None, resource=None, region=None, endpoint=None
except (botocore.exceptions.ProfileNotFound, botocore.exceptions.PartialCredentialsError,
botocore.exceptions.NoCredentialsError, botocore.exceptions.ConfigParseError) as e:
module.fail_json(msg=to_native(e))
except botocore.exceptions.NoRegionError as e:
except botocore.exceptions.NoRegionError:
module.fail_json(msg="The %s module requires a region and none was found in configuration, "
"environment variables or module parameters" % module._name)

Expand Down Expand Up @@ -155,7 +155,7 @@ def get_aws_region(module, boto3=None):
try:
profile_name = module.params.get('profile')
return botocore.session.Session(profile=profile_name).get_config_variable('region')
except botocore.exceptions.ProfileNotFound as e:
except botocore.exceptions.ProfileNotFound:
return None


Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get_aws_account_info(module):
except (botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError):
try:
iam_client = module.client('iam', retry_decorator=AWSRetry.jittered_backoff())
arn, partition, service, reg, account_id, resource = iam_client.get_user(aws_retry=True)['User']['Arn'].split(':')
_arn, partition, _service, _reg, account_id, _resource = iam_client.get_user(aws_retry=True)['User']['Arn'].split(':')
except is_boto3_error_code('AccessDenied') as e:
try:
except_msg = to_native(e.message)
Expand Down
1 change: 0 additions & 1 deletion plugins/module_utils/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ def __init__(self, **kwargs):
if not HAS_BOTO3:
self._module.fail_json(
msg=missing_required_lib('botocore or boto3'))
current_versions = self._gather_versions()
if not self.botocore_at_least('1.21.0'):
self.warn('botocore < 1.21.0 is not supported or tested.'
' Some features may not work.')
Expand Down

0 comments on commit a8c50b2

Please sign in to comment.