浏览代码

Patched options.py to add an extra variable to the dict available to the
configuration sections that provides the host node's name, so you can
easily name processes uniquely on different hosts if you choose to.

Joe Kondel 14 年之前
父节点
当前提交
ddff578dc9
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/supervisor/options.py

+ 3 - 1
src/supervisor/options.py

@@ -29,6 +29,7 @@ import stat
 import pkg_resources
 import select
 import glob
+import platform
 
 from fcntl import fcntl
 from fcntl import F_SETFL, F_GETFL
@@ -789,11 +790,12 @@ class ServerOptions(Options):
                 raise ValueError(
                     '%(process_num) must be present within process_name when '
                     'numprocs > 1')
-
+        host_node_name = platform.node()
         for process_num in range(numprocs_start, numprocs + numprocs_start):
             expansions = {'here':self.here,
                           'process_num':process_num,
                           'program_name':program_name,
+                          'host_node_name':host_node_name,
                           'group_name':group_name}
 
             environment = dict_of_key_value_pairs(