mirror of https://github.com/fail2ban/fail2ban
code review: use the same code (corresponding test cases - with sharing on and without it);
parent
c35b4b24d2
commit
e0eb4f2358
|
@ -204,8 +204,13 @@ after = 1.conf
|
||||||
else:
|
else:
|
||||||
fileNamesFull = filenames
|
fileNamesFull = filenames
|
||||||
|
|
||||||
|
if not fileNamesFull:
|
||||||
|
return []
|
||||||
|
|
||||||
if self._cfg_share is not None:
|
if self._cfg_share is not None:
|
||||||
logSys.debug(" Sharing files: %s", fileNamesFull)
|
logSys.debug(" Sharing files: %s", fileNamesFull)
|
||||||
|
else:
|
||||||
|
logSys.debug(" Reading files: %s", fileNamesFull)
|
||||||
|
|
||||||
if len(fileNamesFull) > 1:
|
if len(fileNamesFull) > 1:
|
||||||
# read multiple configs:
|
# read multiple configs:
|
||||||
|
@ -233,10 +238,6 @@ after = 1.conf
|
||||||
|
|
||||||
# read one config :
|
# read one config :
|
||||||
logSys.debug(" Reading file: %s", fileNamesFull[0])
|
logSys.debug(" Reading file: %s", fileNamesFull[0])
|
||||||
else:
|
|
||||||
# don't have sharing - read one or multiple at once:
|
|
||||||
logSys.debug(" Reading files: %s", fileNamesFull)
|
|
||||||
|
|
||||||
# read file(s) :
|
# read file(s) :
|
||||||
if sys.version_info >= (3,2): # pragma: no cover
|
if sys.version_info >= (3,2): # pragma: no cover
|
||||||
return SafeConfigParser.read(self, fileNamesFull, encoding='utf-8')
|
return SafeConfigParser.read(self, fileNamesFull, encoding='utf-8')
|
||||||
|
|
Loading…
Reference in New Issue