mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
Finish up plugin porting to global display
Also remove display = display which does nothing
This commit is contained in:
parent
2bd695ed42
commit
62979efa14
39 changed files with 68 additions and 92 deletions
|
@ -30,6 +30,12 @@ from ansible import constants as C
|
|||
from ansible.vars import strip_internal_keys
|
||||
from ansible.utils.unicode import to_unicode
|
||||
|
||||
try:
|
||||
from __main__ import display as global_display
|
||||
except ImportError:
|
||||
from ansible.utils.display import Display
|
||||
global_display = Display()
|
||||
|
||||
__all__ = ["CallbackBase"]
|
||||
|
||||
|
||||
|
@ -41,8 +47,12 @@ class CallbackBase:
|
|||
custom actions.
|
||||
'''
|
||||
|
||||
def __init__(self, display):
|
||||
self._display = display
|
||||
def __init__(self, display=None):
|
||||
if display:
|
||||
self._display = display
|
||||
else:
|
||||
self._display = global_display
|
||||
|
||||
if self._display.verbosity >= 4:
|
||||
name = getattr(self, 'CALLBACK_NAME', 'unnamed')
|
||||
ctype = getattr(self, 'CALLBACK_TYPE', 'old')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue