Ensure 'data' remains a dictionary if conf file is empty or missing

This commit is contained in:
Seth House 2016-04-14 11:43:28 -06:00
parent 73d3b77a2c
commit ca61237de7

View file

@ -267,7 +267,7 @@ class MinionSwarm(Swarm):
if self.opts['config_dir']:
spath = os.path.join(self.opts['config_dir'], 'minion')
with open(spath) as conf:
data = yaml.load(conf)
data = yaml.load(conf) or {}
minion_id = '{0}-{1}'.format(
self.opts['name'],
str(idx).zfill(self.zfill)