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

[PR #2393/d22dd505 backport][stable-3] module_helper.py Breakdown #2492

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented May 11, 2021

This is a backport of PR #2393 as merged into main (d22dd50).

SUMMARY

module_helper.py became a somewhat large file: this PR aims at breaking it down into smaller pieces.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

plugins/module_utils/module_helper.py

* break down of module_helper into smaller pieces, keeping compatibility

* removed abc.ABC (py3 only) from code + fixed reference to vars.py

* multiple changes:

- mh.base - moved more functionalities to ModuleHelperBase
- mh.mixins.(cmd, state) - CmdMixin no longer inherits from ModuleHelperBase
- mh.mixins.deps - DependencyMixin now overrides run() method to test dependency
- mh.mixins.vars - created class VarsMixin
- mh.module_helper - moved functions to base class, added VarsMixin
- module_helper - importing AnsibleModule as well, for backward compatibility in test

* removed unnecessary __all__

* make pylint happy

* PR adjustments + bot config + changelog frag

* Update plugins/module_utils/mh/module_helper.py

Co-authored-by: Felix Fontein <[email protected]>

* Update plugins/module_utils/mh/module_helper.py

Co-authored-by: Felix Fontein <[email protected]>

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit d22dd50)
@patchback patchback bot mentioned this pull request May 11, 2021
@ansibullbot
Copy link
Collaborator

cc @russoz
click here for bot help

@ansibullbot ansibullbot added affects_2.10 community_review feature This issue/PR relates to a feature request module module module_utils module_utils needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_maintainer needs_triage new_contributor Help guide this first time contributor plugins plugin (any type) stale_ci CI is older than 7 days, rerun before merging tests tests unit tests/unit labels May 11, 2021
@felixfontein felixfontein merged commit 4cb6f39 into stable-3 May 11, 2021
@felixfontein felixfontein deleted the patchback/backports/stable-3/d22dd5056e62d6b2b8929f732b453214354253b9/pr-2393 branch May 11, 2021 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community_review feature This issue/PR relates to a feature request module_utils module_utils module module needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_maintainer needs_triage new_contributor Help guide this first time contributor plugins plugin (any type) stale_ci CI is older than 7 days, rerun before merging tests tests unit tests/unit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants