SaltStack:ImportError:没有名为 backports.ssl_match_hostname 的模块

SaltStack:ImportError:没有名为 backports.ssl_match_hostname 的模块

我收到此异常:

===> salt-ssh remote-host cmd.run 'id'
remote-host:
    ----------
    retcode:
        0
    stderr:
        Traceback (most recent call last):
          File "/var/tmp/.root_483e1e_salt/salt-call", line 15, in <module>
            salt_call()
          File "/var/tmp/.root_483e1e_salt/py2/salt/scripts.py", line 395, in salt_call
            import salt.cli.call
          File "/var/tmp/.root_483e1e_salt/py2/salt/cli/call.py", line 8, in <module>
            import salt.cli.caller
          File "/var/tmp/.root_483e1e_salt/py2/salt/cli/caller.py", line 18, in <module>
            import salt.loader
          File "/var/tmp/.root_483e1e_salt/py2/salt/loader.py", line 27, in <module>
            import salt.utils.event
          File "/var/tmp/.root_483e1e_salt/py2/salt/utils/event.py", line 70, in <module>
            import tornado.iostream
          File "/var/tmp/.root_483e1e_salt/py2/tornado/iostream.py", line 40, in <module>
            from tornado.netutil import ssl_wrap_socket, ssl_match_hostname, SSLCertificateError, _client_ssl_defaults, _server_ssl_defaults
          File "/var/tmp/.root_483e1e_salt/py2/tornado/netutil.py", line 56, in <module>
            import backports.ssl_match_hostname
        ImportError: No module named backports.ssl_match_hostname
    stdout:

我能做些什么?

版本:2018.3.0

答案1

我修改/usr/lib64/python2.7/site-packages/tornado/netutil.py并设置了 ssl=None。

我在“开始/结束修补程序:”之间添加了一行

try:
    import ssl
except ImportError:
    # ssl is not available on Google App Engine
    ssl = None

# start hotfix 
# https://serverfault.com/questions/911446/saltstack-importerror-no-module-named-backports-ssl-match-hostname/911447#911447
ssl=None
# end hotfix

您需要salt-ssh -t -w在下次使用一次来重新创建远程主机上的 python 文件。

同样的情况也发生在 Salt 版本 2019.2.0 上。

相关问题:https://github.com/saltstack/salt/issues/52453

相关内容