Skip to content

Commit

Permalink
conscience-agent: Ignore empty config file
Browse files Browse the repository at this point in the history
  • Loading branch information
AymericDu committed Jan 29, 2021
1 parent 54b1065 commit 98d9e21
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion oio/conscience/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,16 @@ def load_services(self):
for cfgfile in cfgfiles:
name = os.path.basename(cfgfile)
name = os.path.splitext(name)[0]
self.conf['services'][name] = parse_config(cfgfile)
config = parse_config(cfgfile)
if not config:
self.logger.warning('Ignoring empty config file %s',
cfgfile)
continue
if not isinstance(config, dict):
raise TypeError(
'Expecting YAML dictionary for the config file %s',
cfgfile)
self.conf['services'][name] = config
self.conf['services'][name]['cfgfile'] = cfgfile


Expand Down

0 comments on commit 98d9e21

Please # to comment.