Skip to content

Commit

Permalink
Merge pull request #143 from hakbailey/turbo-server-import-bugfix
Browse files Browse the repository at this point in the history
Move turbo server import statements into try/except block

(cherry picked from commit 86b1ee4)
  • Loading branch information
hakbailey authored and alinabuzachis committed May 23, 2024
1 parent 95baad5 commit 8b0507d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
bugfixes:
- module_utils/turbo/server - Ensure all import statements in run_as_lookup_plugin() are in a try/except block
(https://github.com/ansible-collections/cloud.common/pull/143).
8 changes: 6 additions & 2 deletions plugins/module_utils/turbo/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,18 @@ class FakeStdin:

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.module_utils._text import to_native
from ansible.parsing.dataloader import DataLoader
from ansible.template import Templar
except ImportError as e:
errors = str(e)
return [result, errors]

try:
(
lookup_name,
terms,
Expand Down

0 comments on commit 8b0507d

Please sign in to comment.