mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Do not alow get_event to run with async subscriber
This commit is contained in:
parent
f6aa6ff807
commit
6dcb7182b3
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue