mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-08 07:04:23 -07:00
Fix Log Analytics Ingestion import tests
This commit is contained in:
parent
d27163431f
commit
2ab7ea9496
2 changed files with 9 additions and 1 deletions
|
@ -15,6 +15,7 @@ description:
|
||||||
- Credits to authors of splunk callback plugin.
|
- Credits to authors of splunk callback plugin.
|
||||||
version_added: "2.4.0"
|
version_added: "2.4.0"
|
||||||
requirements:
|
requirements:
|
||||||
|
- The Python 'requests' module.
|
||||||
- Whitelisting this callback plugin.
|
- Whitelisting this callback plugin.
|
||||||
- An Azure log analytics work space has been established.
|
- An Azure log analytics work space has been established.
|
||||||
options:
|
options:
|
||||||
|
|
|
@ -138,7 +138,12 @@ examples: |
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import getpass
|
import getpass
|
||||||
import requests
|
try:
|
||||||
|
import requests
|
||||||
|
except ImportError as exception:
|
||||||
|
IMPORT_ERROR_REQUESTS = exception
|
||||||
|
else:
|
||||||
|
IMPORT_ERROR_REQUESTS = None
|
||||||
import socket
|
import socket
|
||||||
import uuid
|
import uuid
|
||||||
from datetime import datetime, timezone, timedelta
|
from datetime import datetime, timezone, timedelta
|
||||||
|
@ -273,6 +278,8 @@ class CallbackModule(CallbackBase):
|
||||||
CALLBACK_NEEDS_ENABLED = True
|
CALLBACK_NEEDS_ENABLED = True
|
||||||
|
|
||||||
def __init__(self, display=None):
|
def __init__(self, display=None):
|
||||||
|
if IMPORT_ERROR_REQUESTS:
|
||||||
|
raise AnsibleError("'requests' must be installed in order to use this plugin") from IMPORT_ERROR_REQUESTS
|
||||||
super(CallbackModule, self).__init__(display=display)
|
super(CallbackModule, self).__init__(display=display)
|
||||||
self.start_datetimes = {}
|
self.start_datetimes = {}
|
||||||
self.playbook_name = None
|
self.playbook_name = None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue