【问题标题】:Run Salt minion specifying the Python path运行 Salt minion 指定 Python 路径
【发布时间】:2019-10-04 13:54:08
【问题描述】:

有没有办法指定运行 salt-minion 时必须使用的 python 解释器?

我有几个在本地网络上运行的 salt minions。 它们中的大多数都可以正常工作,但是有些 minion 会抛出错误,我们的猜测是 minion 运行的是 python 3 而不是 python 2(我们需要使用salt-2018.3.4-py2

如果我运行 python --version,它会说版本是 3.7。如何强制minion使用python 2.7?

谢谢。

【问题讨论】:

  • 你安装了2.7版本吗?
  • 显示你得到的错误:不要猜测
  • python --version 对工作的奴才说了什么?

标签: python salt-stack


【解决方案1】:

我会说它直接取决于您的安装包。如果您安装了salt-2018.3.4-py2,则意味着它将与py2一起运行。

在我的 minion 上,安装了 salt-2019.2-py3,我有

$ python -V
Python 2.7.13
$ salt-minion --versions
Salt Version:
           Salt: 2019.2.0

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.5.3
      docker-py: Not Installed
          gitdb: 2.0.0
      gitpython: 2.1.1
          ioflo: Not Installed
         Jinja2: 2.9.4
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 3.5.3 (default, Sep 27 2018, 17:25:39)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: 2.0.1
        timelib: Not Installed
        Tornado: 4.4.3
            ZMQ: 4.2.1

System Versions:
           dist: debian 9.9 
         locale: UTF-8
        machine: x86_64
        release: 4.9.0-9-amd64
         system: Linux
        version: debian 9.9 

$ head -1 /usr/bin/salt-minion 
#!/usr/bin/python3

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-11-13
    • 1970-01-01
    • 2023-01-26
    • 1970-01-01
    • 2019-04-18
    • 2015-04-09
    • 2015-02-13
    相关资源
    最近更新 更多