mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Added sanity check: is 'pillar' in self.opts
This fixes an exception that is thrown when using the 'when' clause in a master scheduler. The master does not appear to create a 'pillar' entry in self.opts
This commit is contained in:
parent
174ee10fc2
commit
91e74feaf3
1 changed files with 2 additions and 2 deletions
|
@ -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.'
|
||||
|
|
Loading…
Add table
Reference in a new issue