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_helper.py Breakdown #2393

Merged
merged 8 commits into from
May 11, 2021
Merged

module_helper.py Breakdown #2393

merged 8 commits into from
May 11, 2021

Conversation

russoz
Copy link
Collaborator

@russoz russoz commented May 1, 2021

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

russoz added 4 commits April 28, 2021 21:40
- 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
@russoz russoz changed the title ModHelper Breakdown module_helper.py Breakdown May 1, 2021
@ansibullbot ansibullbot added affects_2.10 community_review feature This issue/PR relates to a feature request module module module_utils module_utils needs_maintainer needs_triage new_plugin New plugin plugins plugin (any type) tests tests unit tests/unit labels May 1, 2021
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides that, looks good.

plugins/module_utils/mh/module_helper.py Outdated Show resolved Hide resolved
plugins/module_utils/mh/module_helper.py Outdated Show resolved Hide resolved
@felixfontein felixfontein added the check-before-release PR will be looked at again shortly before release and merged if possible. label May 3, 2021
@felixfontein felixfontein merged commit d22dd50 into ansible-collections:main May 11, 2021
@patchback
Copy link

patchback bot commented May 11, 2021

Backport to stable-3: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-3/d22dd5056e62d6b2b8929f732b453214354253b9/pr-2393

Backported as #2492

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label May 11, 2021
patchback bot pushed a commit that referenced this pull request May 11, 2021
* 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)
@felixfontein
Copy link
Collaborator

@russoz thanks for improving this!

felixfontein pushed a commit that referenced this pull request May 11, 2021
* 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)

Co-authored-by: Alexei Znamensky <[email protected]>
@russoz russoz deleted the mh_breakdown branch May 11, 2021 23:37
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_maintainer new_plugin New plugin plugins plugin (any type) tests tests unit tests/unit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants