Skip to content

Commit

Permalink
Merge pull request #42 from Onemind-Services-LLC/fix/salt-3007
Browse files Browse the repository at this point in the history
Fixes Salt 3007 compatibility
  • Loading branch information
dmulyalin authored Dec 27, 2024
2 parents 58ca15e + fbd6dc0 commit cd57388
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions salt_nornir/proxy/nornir_proxy_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@
"""

# Import python std lib
import asyncio
import logging
import threading
import multiprocessing
Expand Down Expand Up @@ -718,6 +719,12 @@ def _use_loader_context(func):
def wrapper(*args, **kwargs):
loader = kwargs.pop("loader", None)

# Ensure an asyncio event loop is present
try:
asyncio.get_event_loop()
except RuntimeError:
asyncio.set_event_loop(asyncio.new_event_loop())

if HAS_LOADER_CONTEXT and loader is not None:
with loader_context(loader):
return func(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion test/Dockerfile.ceos1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ceosimage:4.30.0F
FROM ceosimage:4.33.1F

ENV INTFTYPE=eth
ENV ETBA=1
Expand Down
2 changes: 1 addition & 1 deletion test/Dockerfile.ceos2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ceosimage:4.30.0F
FROM ceosimage:4.33.1F

ENV INTFTYPE=eth
ENV ETBA=1
Expand Down

0 comments on commit cd57388

Please sign in to comment.