Procházet zdrojové kódy

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 před 14 roky
rodič
revize
ddff578dc9
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      src/supervisor/options.py

+ 3 - 1
src/supervisor/options.py

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