forked from saltstack/salt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsalt-proxy
executable file
·28 lines (23 loc) · 968 Bytes
/
salt-proxy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python3
"""
This script is used to kick off a salt proxy minion daemon
"""
from multiprocessing import freeze_support
import salt.utils.platform
from salt.scripts import salt_proxy
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)
# This handles the bootstrapping code that is included with frozen
# scripts. It is a no-op on unfrozen code.
freeze_support()
salt_proxy()