RuntimeWarning: coroutine 'main' was never awaited #3164
Unanswered
CarstenGrohmann
asked this question in
Q&A
Replies: 3 comments
-
Sorry but you need to include a way to reproduce the bug, like a minimized playbook that reproduces this error. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Unfortunately, I can't provide a minimized playbook. But I added an additional log line
this results in
Lets take a look in the module implementations of both modules:
Normal Ansible modules looks like:
It looks like some Ansibe modules uses Python coroutines and some not. HTH, |
Beta Was this translation helpful? Give feedback.
0 replies
-
Suggested fix: --- virtualenv/lib/python3.10/site-packages/ansiblelint/rules/args.py.orig 2023-03-21 14:09:21.928090780 +0100
+++ virtualenv/lib/python3.10/site-packages/ansiblelint/rules/args.py 2023-03-21 14:12:49.728926401 +0100
@@ -1,8 +1,10 @@
"""Rule definition to validate task options."""
from __future__ import annotations
+import asyncio
import contextlib
import importlib.util
+import inspect
import io
import json
import logging
@@ -156,7 +158,10 @@
# pylint: disable=protected-access
basic._ANSIBLE_ARGS = None
try:
- module.main()
+ if inspect.iscoroutinefunction(module.main):
+ asyncio.run(module.main())
+ else:
+ module.main()
except SystemExit:
failed_msg = fio.getvalue()
if failed_msg: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
After starting
ansible-lint
complains aboutThis is a software bug, as I understand. Therefore I don't add any details except the used versions.
Issue Type
OS / ENVIRONMENT
Beta Was this translation helpful? Give feedback.
All reactions