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

WIP: Fix Issue #39543 #56508

Open
wants to merge 4 commits into
base: devel
from

Conversation

Projects
None yet
3 participants
@jamespic
Copy link

commented May 16, 2019

SUMMARY

A first attempt at fixing issue #39543, by preventing when clauses being inherited from parents (which is a problem is a role is included from multiple parents, with different when clauses).

There's also a fix for an unrelated issue with hash_params, that I discovered in the process

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

include_role, and role

ADDITIONAL INFORMATION

Apologies for code style issues - this is my first time working on Ansible.

Issue #39543 seems to be caused by the fact that when a role is included via include_role it inherits when clauses from parent roles. However, a role can have multiple chains of parents, depending on where it's included from, and sometimes parent chains from one context are used in other contexts. In the case of issue #39543, the chains are:

role_a -> role_x
role_b (when do_not_run_role) -> role_a -> role_x

It appears that even though role_x is never run via the second chain (because the when clause for role_b never matches), role_b appears as a parent of role_x, and it inherits the when clause from it.

My first attempt at fixing this was to prevent when clauses propagating from parents to children. This broke some tests, so my current approach is to distinguish between roles with different parents in the role cache.

Note that there is also another fix in here, for a bug with hash_params, that I stumbled on when investigating this.

@ansibot

This comment has been minimized.

Copy link
Contributor

commented May 16, 2019

@jamespic this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

jamespic added some commits May 15, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

The test ansible-test sanity --test validate-modules [explain] failed with 2 errors:

lib/ansible/modules/cloud/vmware/vsphere_copy.py:0:0: E309 version_added for new option (host) should be '2.9'. Currently None
lib/ansible/modules/cloud/vmware/vsphere_copy.py:0:0: E309 version_added for new option (login) should be '2.9'. Currently None

click here for bot help

@ansibot ansibot added the stale_ci label May 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.