salt-master 748 B

12345678910111213141516171819202122
  1. #!/usr/bin/env python
  2. '''
  3. Start the salt-master
  4. '''
  5. import salt.utils.platform
  6. from salt.scripts import salt_master
  7. if __name__ == '__main__':
  8. if salt.utils.platform.is_windows():
  9. # Since this file does not have a '.py' extension, when running on
  10. # Windows, spawning any addional processes will fail due to Python
  11. # not being able to load this 'module' in the new process.
  12. # Work around this by creating a '.pyc' file which will enable the
  13. # spawned process to load this 'module' and proceed.
  14. import os.path
  15. import py_compile
  16. cfile = os.path.splitext(__file__)[0] + '.pyc'
  17. if not os.path.exists(cfile):
  18. py_compile.compile(__file__, cfile)
  19. salt_master()