ansible-community / ansible.content_builder

A collection to scaffold Ansible plugins.
GNU General Public License v3.0
31 stars 27 forks source link

vmware_rest: DeprecationWarning: There is no current event loop #68

Open mariolenz opened 11 months ago

mariolenz commented 11 months ago

When running sanity tests with ansible-core 2.16 in vmware.vmware_rest I see:

Running sanity test "import" on Python 3.12
Run command with data: importer.py
Run command with data: importer.py
ERROR: Found 132 import issue(s) on python 3.12 which need to be resolved:
ERROR: plugins/modules/appliance_access_consolecli.py:256:0: traceback: DeprecationWarning: There is no current event loop
.
.
.

ansible-collections/vmware.vmware_rest#432

It looks like you might have to generate different code. At least if you want the sanity tests to succeed. But the message sounds like the code might even break / fail, although I'm not sure what exactly it means. Didn't have the time to investigate yet.

mariolenz commented 11 months ago

Just to make sure this isn't already fixed, I've re-created the modules and still see this issue: ansible-collections/vmware.vmware_rest#435

mariolenz commented 10 months ago

From asyncio.get_event_loop():

As noted above, consider using the higher-level asyncio.run() function, instead of using these lower level functions to manually create and close an event loop.