diff --git a/changelogs/fragments/460-pylint.yml b/changelogs/fragments/460-pylint.yml new file mode 100644 index 00000000000..80ebca43ce9 --- /dev/null +++ b/changelogs/fragments/460-pylint.yml @@ -0,0 +1,2 @@ +minor_changes: +- ec2_instance - remove unnecessary raise when exiting with a failure (https://github.com/ansible-collections/amazon.aws/pull/460). diff --git a/tests/integration/targets/ec2_vol/aliases b/tests/integration/targets/ec2_vol/aliases index b2f0c65bf81..16d5ebe7fd6 100644 --- a/tests/integration/targets/ec2_vol/aliases +++ b/tests/integration/targets/ec2_vol/aliases @@ -1,3 +1,5 @@ +slow + cloud/aws -shippable/aws/group3 + ec2_vol_info diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index 10933291976..d2998d1c886 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -1,3 +1,5 @@ +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 diff --git a/tests/unit/mock/loader.py b/tests/unit/mock/loader.py index 0ee47fbb9f5..00a5841274b 100644 --- a/tests/unit/mock/loader.py +++ b/tests/unit/mock/loader.py @@ -46,12 +46,12 @@ def load_from_file(self, path, cache=True, unsafe=False): # TODO: the real _get_file_contents returns a bytestring, so we actually convert the # unicode/text it's created with to utf-8 - def _get_file_contents(self, path): - path = to_text(path) - if path in self._file_mapping: - return (to_bytes(self._file_mapping[path]), False) + def _get_file_contents(self, file_name): + file_name = to_text(file_name) + if file_name in self._file_mapping: + return (to_bytes(self._file_mapping[file_name]), False) else: - raise AnsibleParserError("file not found: %s" % path) + raise AnsibleParserError("file not found: %s" % file_name) def path_exists(self, path): path = to_text(path) diff --git a/tests/unit/module_utils/test_elbv2.py b/tests/unit/module_utils/test_elbv2.py index ecabe37d31c..3ad6c5ebd1f 100644 --- a/tests/unit/module_utils/test_elbv2.py +++ b/tests/unit/module_utils/test_elbv2.py @@ -7,7 +7,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -import ansible_collections.amazon.aws.plugins.module_utils.elbv2 as elbv2 +from ansible_collections.amazon.aws.plugins.module_utils import elbv2 from ansible_collections.amazon.aws.tests.unit.compat import unittest from ansible_collections.amazon.aws.tests.unit.compat.mock import MagicMock