summaryrefslogtreecommitdiffstats
path: root/ansible_collections/cloud/common/plugins/module_utils
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-18 05:52:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-18 05:52:22 +0000
commit38b7c80217c4e72b1d8988eb1e60bb6e77334114 (patch)
tree356e9fd3762877d07cde52d21e77070aeff7e789 /ansible_collections/cloud/common/plugins/module_utils
parentAdding upstream version 7.7.0+dfsg. (diff)
downloadansible-38b7c80217c4e72b1d8988eb1e60bb6e77334114.tar.xz
ansible-38b7c80217c4e72b1d8988eb1e60bb6e77334114.zip
Adding upstream version 9.4.0+dfsg.upstream/9.4.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ansible_collections/cloud/common/plugins/module_utils')
-rw-r--r--ansible_collections/cloud/common/plugins/module_utils/turbo/server.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/ansible_collections/cloud/common/plugins/module_utils/turbo/server.py b/ansible_collections/cloud/common/plugins/module_utils/turbo/server.py
index 77fbb6493..04ddf67f3 100644
--- a/ansible_collections/cloud/common/plugins/module_utils/turbo/server.py
+++ b/ansible_collections/cloud/common/plugins/module_utils/turbo/server.py
@@ -51,6 +51,7 @@ env_lock = None
import ansible.module_utils.basic
+
please_include_me = "bar"
@@ -224,6 +225,7 @@ async def run_as_lookup_plugin(data):
errors = None
from ansible.module_utils._text import to_native
+ result = None
try:
import ansible.plugins.loader as plugin_loader
from ansible.parsing.dataloader import DataLoader
@@ -257,10 +259,12 @@ async def run_as_lookup_plugin(data):
result = instance._run(terms, variables=variables, **kwargs)
except Exception as e:
errors = to_native(e)
+
return [result, errors]
async def run_as_module(content, debug_mode):
+ result = None
from ansible_collections.cloud.common.plugins.module_utils.turbo.exceptions import (
EmbeddedModuleFailure,
)
@@ -325,11 +329,13 @@ class AnsibleVMwareTurboMode:
self.stop()
async def handle(self, reader, writer):
+ result = None
self._watcher.cancel()
self._watcher = self.loop.create_task(self.ghost_killer())
job_id = str(uuid.uuid4())
self.jobs_ongoing[job_id] = datetime.now()
raw_data = await reader.read()
+
if not raw_data:
return
@@ -359,6 +365,14 @@ class AnsibleVMwareTurboMode:
import sys
+ try:
+ from ansible.plugins.loader import init_plugin_loader
+
+ init_plugin_loader()
+ except ImportError:
+ # Running on Ansible < 2.15
+ pass
+
if sys.hexversion >= 0x30A00B1:
# py3.10 drops the loop argument of create_task.
self.loop.create_task(