mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-23 12:33:59 -07:00
parent
9d0150b2c3
commit
6cd4665412
34 changed files with 70 additions and 120 deletions
|
@ -27,7 +27,6 @@ try:
|
|||
except ImportError:
|
||||
pass
|
||||
|
||||
from ansible.module_utils.six import binary_type, text_type
|
||||
from collections.abc import MutableMapping, MutableSequence
|
||||
from ansible.plugins.callback.default import CallbackModule as CallbackModule_default
|
||||
from ansible.utils.color import colorize, hostcolor
|
||||
|
@ -236,7 +235,7 @@ class CallbackModule(CallbackModule_default):
|
|||
|
||||
# Remove empty attributes (list, dict, str)
|
||||
for attr in result.copy():
|
||||
if isinstance(result[attr], (MutableSequence, MutableMapping, binary_type, text_type)):
|
||||
if isinstance(result[attr], (MutableSequence, MutableMapping, bytes, str)):
|
||||
if not result[attr]:
|
||||
del result[attr]
|
||||
|
||||
|
|
|
@ -88,7 +88,6 @@ from os.path import basename
|
|||
|
||||
from ansible.errors import AnsibleError, AnsibleRuntimeError
|
||||
from ansible.module_utils.ansible_release import __version__ as ansible_version
|
||||
from ansible.module_utils.six import raise_from
|
||||
from ansible.plugins.callback import CallbackBase
|
||||
|
||||
try:
|
||||
|
@ -308,9 +307,7 @@ class CallbackModule(CallbackBase):
|
|||
self.disabled = False
|
||||
|
||||
if ELASTIC_LIBRARY_IMPORT_ERROR:
|
||||
raise_from(
|
||||
AnsibleError('The `elastic-apm` must be installed to use this plugin'),
|
||||
ELASTIC_LIBRARY_IMPORT_ERROR)
|
||||
raise AnsibleError('The `elastic-apm` must be installed to use this plugin') from ELASTIC_LIBRARY_IMPORT_ERROR
|
||||
|
||||
self.tasks_data = OrderedDict()
|
||||
|
||||
|
|
|
@ -66,7 +66,8 @@ options:
|
|||
type: string
|
||||
"""
|
||||
|
||||
from ansible.module_utils.six.moves.urllib.parse import urlencode
|
||||
from urllib.parse import urlencode
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_bytes
|
||||
from ansible.module_utils.urls import open_url
|
||||
from ansible.plugins.callback import CallbackBase
|
||||
|
|
|
@ -137,15 +137,13 @@ import json
|
|||
import os
|
||||
import socket
|
||||
import uuid
|
||||
from time import time_ns
|
||||
|
||||
from collections import OrderedDict
|
||||
from os.path import basename
|
||||
from time import time_ns
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.module_utils.ansible_release import __version__ as ansible_version
|
||||
from ansible.module_utils.six import raise_from
|
||||
from ansible.module_utils.six.moves.urllib.parse import urlparse
|
||||
from ansible.plugins.callback import CallbackBase
|
||||
|
||||
try:
|
||||
|
@ -495,9 +493,9 @@ class CallbackModule(CallbackBase):
|
|||
self.otel_exporter_otlp_traces_protocol = None
|
||||
|
||||
if OTEL_LIBRARY_IMPORT_ERROR:
|
||||
raise_from(
|
||||
AnsibleError('The `opentelemetry-api`, `opentelemetry-exporter-otlp` or `opentelemetry-sdk` must be installed to use this plugin'),
|
||||
OTEL_LIBRARY_IMPORT_ERROR)
|
||||
raise AnsibleError(
|
||||
'The `opentelemetry-api`, `opentelemetry-exporter-otlp` or `opentelemetry-sdk` must be installed to use this plugin'
|
||||
) from OTEL_LIBRARY_IMPORT_ERROR
|
||||
|
||||
self.tasks_data = OrderedDict()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue