mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-04 23:44:00 -07:00
adding display to plugins and start moving debug to display
This commit is contained in:
parent
5d51f3abda
commit
851ed45bbf
20 changed files with 152 additions and 109 deletions
10
lib/ansible/plugins/cache/__init__.py
vendored
10
lib/ansible/plugins/cache/__init__.py
vendored
|
@ -22,12 +22,20 @@ from collections import MutableMapping
|
|||
from ansible import constants as C
|
||||
from ansible.plugins import cache_loader
|
||||
|
||||
try:
|
||||
from __main__ import display
|
||||
except ImportError:
|
||||
from ansible.utils.display import Display
|
||||
display = Display()
|
||||
|
||||
class FactCache(MutableMapping):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self._plugin = cache_loader.get(C.CACHE_PLUGIN)
|
||||
self._display = display
|
||||
|
||||
if self._plugin is None:
|
||||
# FIXME: this should be an exception
|
||||
self._display.warning("Failed to load fact cache plugins")
|
||||
return
|
||||
|
||||
def __getitem__(self, key):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue