summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cammarata <jimi@sngx.net>2016-11-23 12:21:14 -0600
committerJames Cammarata <jimi@sngx.net>2016-11-23 12:21:14 -0600
commit768d94192bf1775873bf9548881e4438fb47fe2d (patch)
tree165f844b4d43fe0459a6db87e5e45a665ce232d3
parent9d0b8c854528d7f23707c73b8f65f6a9de60cbf6 (diff)
downloadansible-issue_18522_inheritance_bug.tar.gz
Look for _get_parent_attribute method in both src and dst dictissue_18522_inheritance_bug
When determining which getter style to use for the object in question, the BaseMeta class should look at both dict's to try and locate the method. Fixes #18522
-rw-r--r--lib/ansible/playbook/base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/playbook/base.py b/lib/ansible/playbook/base.py
index 6c952128a9..11f908d181 100644
--- a/lib/ansible/playbook/base.py
+++ b/lib/ansible/playbook/base.py
@@ -111,7 +111,7 @@ class BaseMeta(type):
method = "_get_attr_%s" % attr_name
if method in src_dict or method in dst_dict:
getter = partial(_generic_g_method, attr_name)
- elif '_get_parent_attribute' in dst_dict and value.inherit:
+ elif ('_get_parent_attribute' in dst_dict or '_get_parent_attribute' in src_dict) and value.inherit:
getter = partial(_generic_g_parent, attr_name)
else:
getter = partial(_generic_g, attr_name)