mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-07 06:34: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.
|
||||
version_added: "2.4.0"
|
||||
requirements:
|
||||
- The Python 'requests' module.
|
||||
- Whitelisting this callback plugin.
|
||||
- An Azure log analytics work space has been established.
|
||||
options:
|
||||
|
|
|
@ -138,7 +138,12 @@ examples: |
|
|||
'''
|
||||
|
||||
import getpass
|
||||
import requests
|
||||
try:
|
||||
import requests
|
||||
except ImportError as exception:
|
||||
IMPORT_ERROR_REQUESTS = exception
|
||||
else:
|
||||
IMPORT_ERROR_REQUESTS = None
|
||||
import socket
|
||||
import uuid
|
||||
from datetime import datetime, timezone, timedelta
|
||||
|
@ -273,6 +278,8 @@ class CallbackModule(CallbackBase):
|
|||
CALLBACK_NEEDS_ENABLED = True
|
||||
|
||||
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)
|
||||
self.start_datetimes = {}
|
||||
self.playbook_name = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue