From 73e171fd946b74089a99051858d8d49e561dea41 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Mon, 18 Mar 2019 20:10:56 +0530 Subject: [PATCH] loader: Avoid loading autosave files (#53856) Signed-off-by: Abhijeet Kasurde --- lib/ansible/plugins/loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/loader.py b/lib/ansible/plugins/loader.py index 9e3195d634..d7746a50aa 100644 --- a/lib/ansible/plugins/loader.py +++ b/lib/ansible/plugins/loader.py @@ -345,7 +345,7 @@ class PluginLoader: # HACK: We have no way of executing python byte compiled files as ansible modules so specifically exclude them # FIXME: I believe this is only correct for modules and module_utils. # For all other plugins we want .pyc and .pyo should be valid - if full_path.endswith(('.pyc', '.pyo')): + if any(full_path.endswith(x) for x in C.BLACKLIST_EXTS): continue splitname = os.path.splitext(full_name)