Merge pull request #31391 from redmcg/master_schedule_fix

Added sanity check: is 'pillar' in self.opts
This commit is contained in:
Erik Johnson 2016-02-22 14:05:27 -06:00
commit ac6af79abc

View file

@ -867,7 +867,7 @@ class Schedule(object):
if isinstance(data['when'], list):
_when = []
for i in data['when']:
if ('whens' in self.opts['pillar'] and
if ('pillar' in self.opts and 'whens' in self.opts['pillar'] and
i in self.opts['pillar']['whens']):
if not isinstance(self.opts['pillar']['whens'],
dict):
@ -936,7 +936,7 @@ class Schedule(object):
continue
else:
if ('whens' in self.opts['pillar'] and
if ('pillar' in self.opts and 'whens' in self.opts['pillar'] and
data['when'] in self.opts['pillar']['whens']):
if not isinstance(self.opts['pillar']['whens'], dict):
log.error('Pillar item "whens" must be dict.'