mirror of
https://github.com/saltstack/salt.git
synced 2025-04-10 06:41:40 +00:00

Since the master branch no longer supports Python 2, and many distros still default /usr/bin/python to Python 2, this commit changes the scripts to explicitly call Python 3.
22 lines
749 B
Python
Executable file
22 lines
749 B
Python
Executable file
#!/usr/bin/env python3
|
|
"""
|
|
Start the salt-master
|
|
"""
|
|
|
|
import salt.utils.platform
|
|
from salt.scripts import salt_master
|
|
|
|
if __name__ == "__main__":
|
|
if salt.utils.platform.is_windows():
|
|
# Since this file does not have a '.py' extension, when running on
|
|
# Windows, spawning any addional processes will fail due to Python
|
|
# not being able to load this 'module' in the new process.
|
|
# Work around this by creating a '.pyc' file which will enable the
|
|
# spawned process to load this 'module' and proceed.
|
|
import os.path
|
|
import py_compile
|
|
|
|
cfile = os.path.splitext(__file__)[0] + ".pyc"
|
|
if not os.path.exists(cfile):
|
|
py_compile.compile(__file__, cfile)
|
|
salt_master()
|