Do not alow get_event to run with async subscriber

This commit is contained in:
Daniel A. Wozniak 2025-01-18 20:47:13 -07:00 committed by Daniel Wozniak
parent f6aa6ff807
commit 6dcb7182b3

View file

@ -75,6 +75,7 @@ import salt.utils.platform
import salt.utils.process
import salt.utils.stringutils
import salt.utils.zeromq
from salt.exceptions import SaltInvocationError
log = logging.getLogger(__name__)
@ -567,6 +568,9 @@ class SaltEvent:
try:
if not self.cpub and not self.connect_pub(timeout=wait):
break
if not self._run_io_loop_sync:
log.error("Trying to get event with async subscriber")
raise SaltInvocationError("get_event needs synchornous subscriber")
raw = self.subscriber.read(timeout=wait)
if raw is None:
break