From 9eb3d6811bfbdc9c776f2c549c642a9d8db3fa56 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 11 Aug 2022 09:51:35 -0700 Subject: [PATCH] find - Use `getattr` instead of `__getattribute__` (#78503) --- lib/ansible/modules/find.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/find.py b/lib/ansible/modules/find.py index 788eb71ded9..218f3893e9b 100644 --- a/lib/ansible/modules/find.py +++ b/lib/ansible/modules/find.py @@ -291,9 +291,9 @@ def agefilter(st, now, age, timestamp): '''filter files older than age''' if age is None: return True - elif age >= 0 and now - st.__getattribute__("st_%s" % timestamp) >= abs(age): + elif age >= 0 and now - getattr(st, "st_%s" % timestamp) >= abs(age): return True - elif age < 0 and now - st.__getattribute__("st_%s" % timestamp) <= abs(age): + elif age < 0 and now - getattr(st, "st_%s" % timestamp) <= abs(age): return True return False