Skip to content

Commit

Permalink
Backport - Fixup / ignore new pylint 2.9.3 issues (#460) (#491)
Browse files Browse the repository at this point in the history
Backport - Fixup / ignore new pylint 2.9.3 issues

SUMMARY
The containers have been updated to include a new version of pylint ( ansible-collections/overview#45 )
fixup arguments-renamed
ignore pylint:use-a-generator (an easy fix but not worth blocking gating)
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
tests/unit/mock/loader.py
tests/unit/module_utils/test_elbv2.py
ADDITIONAL INFORMATION
Backport of #460
Depends-On: ansible/ansible-zuul-jobs#1097

Reviewed-by: Alina Buzachis <None>
Reviewed-by: None <None>
  • Loading branch information
tremble authored Sep 8, 2021
1 parent 85c6178 commit f309a46
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/460-pylint.yml
Original file line number Diff line number Diff line change
@@ -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).
4 changes: 3 additions & 1 deletion tests/integration/targets/ec2_vol/aliases
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
slow

cloud/aws
shippable/aws/group3

ec2_vol_info
2 changes: 2 additions & 0 deletions tests/sanity/ignore-2.12.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/mock/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/module_utils/test_elbv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f309a46

Please sign in to comment.