From 3e4755f7e416f14d6574f8d8196db7e1243fc74d Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Thu, 23 Jun 2016 16:46:16 -0500 Subject: [PATCH] Remove unnecessary role initialization and lookup stuff * Remove unnecessary copying of values from parents to role deps, as this can cause problems when roles have multiple parents (or the same parents with different params speficied through deps) * Since we're already checking the dep chain in the block for role things (which every task in a role should have), it is not necessary to check the role directly in case it improperly grabs something Fixes #14438 --- lib/ansible/playbook/block.py | 3 --- lib/ansible/playbook/role/__init__.py | 10 ---------- 2 files changed, 13 deletions(-) diff --git a/lib/ansible/playbook/block.py b/lib/ansible/playbook/block.py index 1f52dfbf888..392b00b2948 100644 --- a/lib/ansible/playbook/block.py +++ b/lib/ansible/playbook/block.py @@ -269,9 +269,6 @@ class Block(Base, Become, Conditional, Taggable): if self._parent_block is not None: if not self._parent_block.evaluate_conditional(templar, all_vars): return False - elif self._role is not None: - if not self._role.evaluate_conditional(templar, all_vars): - return False return super(Block, self).evaluate_conditional(templar, all_vars) def set_loader(self, loader): diff --git a/lib/ansible/playbook/role/__init__.py b/lib/ansible/playbook/role/__init__.py index 7523bdae9d3..6793feb343c 100644 --- a/lib/ansible/playbook/role/__init__.py +++ b/lib/ansible/playbook/role/__init__.py @@ -118,16 +118,6 @@ class Role(Base, Become, Conditional, Taggable): if role_include.role not in play.ROLE_CACHE: play.ROLE_CACHE[role_include.role] = dict() - if parent_role: - if parent_role.when: - new_when = parent_role.when[:] - new_when.extend(r.when or []) - r.when = new_when - if parent_role.tags: - new_tags = parent_role.tags[:] - new_tags.extend(r.tags or []) - r.tags = new_tags - play.ROLE_CACHE[role_include.role][hashed_params] = r return r