Skip to content

Commit

Permalink
Merge pull request #31391 from redmcg/master_schedule_fix
Browse files Browse the repository at this point in the history
Added sanity check: is 'pillar' in self.opts
  • Loading branch information
Erik Johnson committed Feb 22, 2016
2 parents c7bd13c + 91e74fe commit ac6af79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions salt/utils/schedule.py
Expand Up @@ -867,7 +867,7 @@ def eval(self):
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):
Expand Down Expand Up @@ -936,7 +936,7 @@ def eval(self):
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.'
Expand Down

0 comments on commit ac6af79

Please sign in to comment.