mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Make selective callback work with ansible-core 2.11. (#1807)
This commit is contained in:
parent
0a5f79724c
commit
367c3c43ff
2 changed files with 12 additions and 1 deletions
2
changelogs/fragments/selective-core-2.11.yml
Normal file
2
changelogs/fragments/selective-core-2.11.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- "selective callback plugin - adjust import so that the plugin also works with ansible-core 2.11 (https://github.com/ansible-collections/community.general/pull/1807)."
|
|
@ -41,8 +41,17 @@ import difflib
|
||||||
from ansible import constants as C
|
from ansible import constants as C
|
||||||
from ansible.plugins.callback import CallbackBase
|
from ansible.plugins.callback import CallbackBase
|
||||||
from ansible.module_utils._text import to_text
|
from ansible.module_utils._text import to_text
|
||||||
|
|
||||||
|
try:
|
||||||
|
codeCodes = C.COLOR_CODES
|
||||||
|
except AttributeError:
|
||||||
|
# This constant was moved to ansible.constants in
|
||||||
|
# https://github.com/ansible/ansible/commit/1202dd000f10b0e8959019484f1c3b3f9628fc67
|
||||||
|
# (will be included in ansible-core 2.11.0). For older Ansible/ansible-base versions,
|
||||||
|
# we include from the original location.
|
||||||
from ansible.utils.color import codeCodes
|
from ansible.utils.color import codeCodes
|
||||||
|
|
||||||
|
|
||||||
DONT_COLORIZE = False
|
DONT_COLORIZE = False
|
||||||
COLORS = {
|
COLORS = {
|
||||||
'normal': '\033[0m',
|
'normal': '\033[0m',
|
||||||
|
|
Loading…
Reference in a new issue