From: Ian Jackson Date: Mon, 24 Apr 2017 12:21:50 +0000 (+0100) Subject: process putatives: break out log_ignore X-Git-Url: https://git.distorted.org.uk/~mdw/hippotat/commitdiff_plain/43dd2ce0d23e167056130e6bcbbdb380d203ed3a process putatives: break out log_ignore No significant functional change. Signed-off-by: Ian Jackson --- diff --git a/hippotatlib/__init__.py b/hippotatlib/__init__.py index aa5b06c..19a6aef 100644 --- a/hippotatlib/__init__.py +++ b/hippotatlib/__init__.py @@ -390,6 +390,10 @@ def _cfg_process_putatives(): server_pat + r' ' + '(?:' + client_pat + '|LIMIT)') for cs in cfg.sections(): + def log_ignore(why): + print('warning: ignoring config section [%s] (%s)' % (cs, why), + file=sys.stderr) + if cs == 'LIMIT' or cs == 'COMMON': # plan A "[LIMIT]" or "[COMMON]" continue @@ -417,8 +421,7 @@ def _cfg_process_putatives(): ci = ipaddr(pc) except AddressValueError: # plan F "[]" - # well, we ignore this - print('warning: ignoring config section %s' % cs, file=sys.stderr) + log_ignore('bad-addr') continue else: # no AddressValueError