From 1ab0e0e228a82c20b092913ce5c8b9b0e2f67f4e Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Fri, 16 Oct 2015 15:33:54 -0400 Subject: [PATCH] Disable RuntimeWarnings during all() plugin loading Fixes #12778 --- lib/ansible/plugins/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/__init__.py b/lib/ansible/plugins/__init__.py index fd1c110fea..182ac5a06a 100644 --- a/lib/ansible/plugins/__init__.py +++ b/lib/ansible/plugins/__init__.py @@ -26,6 +26,8 @@ import inspect import os import os.path import sys +import warnings + from collections import defaultdict from ansible import constants as C @@ -340,7 +342,9 @@ class PluginLoader: continue if path not in self._module_cache: - self._module_cache[path] = self._load_module_source(name, path) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", RuntimeWarning) + self._module_cache[path] = self._load_module_source(name, path) if kwargs.get('class_only', False): obj = getattr(self._module_cache[path], self.class_name)