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

[2.9 backport] add optional module_utils import support (#73832) #73916

Merged
merged 1 commit into from Apr 5, 2021

Conversation

nitzmahone
Copy link
Member

@nitzmahone nitzmahone commented Mar 16, 2021

SUMMARY

backport of #73832

  • add optional module_utils import support
    Treat core and collections module_utils imports nested within any Python block statement (eg, try, if) as optional. This allows Ansible modules to implement runtime fallback behavior for missing module_utils (eg from a newer version of ansible-core), where previously, the module payload builder would always fail when unable to locate a module_util (regardless of any runtime behavior the module may implement).

ci_complete

(cherry-picked from 3e1f648)

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

module_common

ADDITIONAL INFORMATION

* add optional module_utils import support
Treat  core and collections module_utils imports nested within any Python block statement (eg, `try`, `if`) as optional. This allows Ansible modules to implement runtime fallback behavior for missing module_utils (eg from a newer version of ansible-core), where previously, the module payload builder would always fail when unable to locate a module_util (regardless of any runtime behavior the module may implement).

* sanity test fixes

ci_complete

(cherry-picked from 3e1f648)
@nitzmahone nitzmahone changed the title add optional module_utils import support (#73832) [2.9 backport] add optional module_utils import support (#73832) Mar 16, 2021
@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 backport This PR does not target the devel branch. 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:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Mar 16, 2021
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Mar 26, 2021
@relrod relrod merged commit f8caa43 into ansible:stable-2.9 Apr 5, 2021
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Apr 19, 2021
@ansible ansible locked and limited conversation to collaborators May 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 backport This PR does not target the devel branch. core_review In order to be merged, this PR must follow the core review workflow. feature This issue/PR relates to a feature request. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants