From a60a7279d03ad736e4fbf8ae8e7b12420ad783a1 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Wed, 23 Nov 2016 12:21:14 -0600 Subject: [PATCH] Look for _get_parent_attribute method in both src and dst dict 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 (cherry picked from commit 4859e0a41903a98b3f625bdebf4b4414189ac9e1) --- lib/ansible/playbook/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/playbook/base.py b/lib/ansible/playbook/base.py index 6c952128a98..11f908d1816 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)