0

文档中的示例:

# Job on minion
import salt.utils.event

opts = salt.config.minion_config(salt.minion.DEFAULT_MINION_OPTS)
event = salt.utils.event.MinionEvent(opts)

for evdata in event.iter_events(match_type="regex", tag="custom/.*"):
    # do your processing here...
    ...

我从 master salt '*' test.ping 发送,这段代码什么也没返回。我尝试将 MinionEvent 更改为 MasterEvent 或 SaltEvent 或其他,结果相同

C:\Windows\system32>salt-call state.event pretty=True
c:\salt\bin\lib\site-packages\salt-3000.3-py3.7.egg\salt\ext\tornado\httputil.py:107: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  class HTTPHeaders(collections.MutableMapping):
[WARNING ] c:\salt\bin\lib\site-packages\salt-3000.3-py3.7.egg\salt\utils\dictdiffer.py:16: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Mapping

[WARNING ] [WinError 2] Не удается найти указанный файл (in english it means - file not found)

该命令也不返回结果并写一些警告

C:\Windows\system32>salt-call saltutil.running
c:\salt\bin\lib\site-packages\salt-3000.3-py3.7.egg\salt\ext\tornado\httputil.py:107: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  class HTTPHeaders(collections.MutableMapping):
[WARNING ] c:\salt\bin\lib\site-packages\salt-3000.3-py3.7.egg\salt\utils\dictdiffer.py:16: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Mapping

[WARNING ] [WinError 2] Не удается найти указанный файл
[WARNING ] c:\salt\bin\lib\site-packages\salt-3000.3-py3.7.egg\salt\utils\decorators\signature.py:31: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
  *salt.utils.args.get_function_argspec(original_function)

[WARNING ] c:\salt\bin\lib\site-packages\salt-3000.3-py3.7.egg\salt\utils\oset.py:47: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  class OrderedSet(collections.MutableSet):

[WARNING ] c:\salt\bin\lib\site-packages\salt-3000.3-py3.7.egg\salt\utils\decorators\signature.py:31: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
  *salt.utils.args.get_function_argspec(original_function)

[WARNING ] c:\salt\bin\lib\site-packages\salt-3000.3-py3.7.egg\salt\modules\file.py:32: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Iterable, Mapping, namedtuple

local:

这是另一个命令的结果

4

0 回答 0