salt-proxy 1.0 KB

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. '''
  4. This script is used to kick off a salt proxy minion daemon
  5. '''
  6. from __future__ import absolute_import
  7. import salt.utils.platform
  8. from salt.scripts import salt_proxy
  9. from multiprocessing import freeze_support
  10. if __name__ == '__main__':
  11. if salt.utils.platform.is_windows():
  12. # Since this file does not have a '.py' extension, when running on
  13. # Windows, spawning any addional processes will fail due to Python
  14. # not being able to load this 'module' in the new process.
  15. # Work around this by creating a '.pyc' file which will enable the
  16. # spawned process to load this 'module' and proceed.
  17. import os.path
  18. import py_compile
  19. cfile = os.path.splitext(__file__)[0] + '.pyc'
  20. if not os.path.exists(cfile):
  21. py_compile.compile(__file__, cfile)
  22. # This handles the bootstrapping code that is included with frozen
  23. # scripts. It is a no-op on unfrozen code.
  24. freeze_support()
  25. salt_proxy()