[Supervisor-checkins] r809 - supervisor/trunk/src/supervisor
Chris McDonough
chrism at agendaless.com
Wed Aug 20 18:43:37 EDT 2008
Author: Chris McDonough <chrism at agendaless.com>
Date: Wed Aug 20 18:43:36 2008
New Revision: 809
Log:
Fix bug with symptom "KeyError: 'process_name'" when using a logfile name including documented 'process_name' Python string expansions.
Modified:
supervisor/trunk/src/supervisor/options.py
Modified: supervisor/trunk/src/supervisor/options.py
==============================================================================
--- supervisor/trunk/src/supervisor/options.py (original)
+++ supervisor/trunk/src/supervisor/options.py Wed Aug 20 18:43:36 2008
@@ -737,17 +737,6 @@
'%(process_num) must be present within process_name when '
'numprocs > 1')
- for n in ('stdout_logfile', 'stderr_logfile'):
- # do warning
- lf_name = logfile_name(get(section, n, Automatic))
- mb_key = '%s_maxbytes' % n
- maxbytes = byte_size(get(section, mb_key, '50MB'))
- if not maxbytes and lf_name is Automatic:
- self.parse_warnings.append(
- 'For [%s], AUTO logging used for %s without '
- 'rollover, set maxbytes > 0 to avoid filling up '
- 'filesystem unintentionally' % (section, n))
-
for process_num in range(numprocs_start, numprocs + numprocs_start):
expansions = {'here':self.here,
'process_num':process_num,
@@ -764,10 +753,10 @@
for k in ('stdout', 'stderr'):
n = '%s_logfile' % k
- val = logfile_name(get(section, n, Automatic))
- if isinstance(val, basestring):
- val = expand(val, expansions, n)
- logfiles[n] = val
+ lf_val = logfile_name(get(section, n, Automatic))
+ if isinstance(lf_val, basestring):
+ lf_val = expand(lf_val, expansions, n)
+ logfiles[n] = lf_val
bu_key = '%s_logfile_backups' % k
backups = integer(get(section, bu_key, 10))
@@ -777,6 +766,12 @@
maxbytes = byte_size(get(section, mb_key, '50MB'))
logfiles[mb_key] = maxbytes
+ if lf_val is Automatic and not maxbytes:
+ self.parse_warnings.append(
+ 'For [%s], AUTO logging used for %s without '
+ 'rollover, set maxbytes > 0 to avoid filling up '
+ 'filesystem unintentionally' % (section, n))
+
pconfig = klass(
self,
name=expand(process_name, expansions, 'process_name'),
More information about the Supervisor-checkins
mailing list