diff --git a/lib/ansible/playbook/base.py b/lib/ansible/playbook/base.py index 711857c1947..0343344be95 100644 --- a/lib/ansible/playbook/base.py +++ b/lib/ansible/playbook/base.py @@ -96,7 +96,7 @@ class Base: @staticmethod def _generic_g(prop_name, self): method = "_get_attr_%s" % prop_name - if method in dir(self): + if hasattr(self, method): return getattr(self, method)() return self._attributes[prop_name]