Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module validation: don't complain if type() is used in if #54849

Merged
merged 1 commit into from
Apr 9, 2019

Conversation

felixfontein
Copy link
Contributor

SUMMARY

The Type comparison using type() found. Use isinstance() instead condition is too strict, it also has a problem with things like if self.key.type() == crypto.TYPE_RSA:, which has nothing to do with type comparisons. This improves the check by making sure that check() is ignored, only check( followed by something else than ) is considered. This still can cause false negatives, but fewer of them.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

test/sanity/validate-modules/main.py

@ansibot
Copy link
Contributor

ansibot commented Apr 4, 2019

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 core_review In order to be merged, this PR must follow the core review workflow. feature This issue/PR relates to a feature request. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests. labels Apr 4, 2019
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Apr 9, 2019
@bcoca bcoca requested a review from sivel April 9, 2019 20:08
@sivel sivel merged commit df72317 into ansible:devel Apr 9, 2019
@felixfontein felixfontein deleted the improve-sanity-tests branch April 10, 2019 03:34
@felixfontein
Copy link
Contributor Author

@sivel thanks for merging this!

@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 core_review In order to be merged, this PR must follow the core review workflow. feature This issue/PR relates to a feature request. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants