From 43dd2ce0d23e167056130e6bcbbdb380d203ed3a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 24 Apr 2017 13:21:50 +0100 Subject: [PATCH] process putatives: break out log_ignore No significant functional change. Signed-off-by: Ian Jackson --- hippotatlib/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.11.0