Do not try to read empty filename configuration

configfile can be a list with None values as the default argument value is a
list with TRYTOND_CONFIG environment variable which could be not set.

issue6101
review25891002
This commit is contained in:
Cédric Krier
2016-12-13 18:36:52 +01:00
parent 015603c847
commit cbf4e70c09
+3 -1
View File
@@ -68,7 +68,9 @@ class TrytonConfigParser(ConfigParser.RawConfigParser):
self.update_etc()
def update_etc(self, configfile=os.environ.get('TRYTOND_CONFIG')):
if not configfile:
if isinstance(configfile, basestring):
configfile = [configfile]
if not configfile or not filter(None, configfile):
return
read_files = self.read(configfile)
logger.info('using %s as configuration files', ', '.join(read_files))