Solve the saltstack "ImportError: No module named salt. scripts" error

Source: Internet
Author: User

Solve the saltstack "ImportError: No module named salt. scripts" error

I. Problem Description

The automated management tools used on the production line are saltstack, CentOS6.8 x64, and python 2.6.6. They are called not dead. Because some features require python2.7.x, after the upgrade of python2.7, I wrote the saltstack api and found that python2.7 is difficult to use. The principle is that there is no salt module in python2.7. Therefore, pip install salt successfully installs the salt module in python2.7, but I found an error when I restarted salt-master. For example:

Production line, but this cannot be done. Hurry up and recover. Pip uninstall salt

The problem still persists when the salt is started after the module under salt 2.7 is properly loaded.

File "/usr/bin/salt-master", line 6, in <module>
From salt. scripts import salt_master
ImportError: No module named salt. scripts

Ii. Problem Solving

So let's take a look at the source code cat/usr/bin/salt-master, one of the following

From salt. scripts import salt_master

Combined with the error prompt, it is obvious that the module to be imported cannot be started. If the salt module location under python 2.6 is found

/Usr/lib/python2.6/site-packages/salt/

The scripts. py module is not found. Is it true that even the collision module of 2.7 will be able to withstand the attack? The directory contains scripts. po.

This indicates that this module File was available before, but this salt module package is not backed up?

Iii. Solutions

Install salt-master on CentOS6.8 and find the corresponding scripts. uploading py to the production environment is similar to an error. Well, I will package all the salt packages (directories) and overwrite them. Solve the problem!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.