mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user