Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Commit

Permalink
fix: call init_plugin_loader to fix module loading during module arg …
Browse files Browse the repository at this point in the history
…parse (#612)
  • Loading branch information
xoxys authored May 31, 2023
1 parent 6bde8f1 commit c4d406f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ansiblelater/utils/yamlhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def ansible_template(basedir, varname, templatevars, **kwargs):
try:
from ansible.plugins import module_loader
except ImportError:
from ansible.plugins.loader import module_loader
from ansible.plugins.loader import init_plugin_loader, module_loader
init_plugin_loader()

LINE_NUMBER_KEY = "__line__"
FILENAME_KEY = "__file__"
Expand Down Expand Up @@ -411,7 +412,7 @@ def normalize_task(task, filename, custom_modules=None):
try:
action, arguments, normalized["delegate_to"] = mod_arg_parser.parse()
except AnsibleParserError as e:
raise LaterAnsibleError("syntax error", e) from e
raise LaterAnsibleError(e) from e

# denormalize shell -> command conversion
if "_uses_shell" in arguments:
Expand Down

0 comments on commit c4d406f

Please sign in to comment.