Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make requisites fail correctly

  • Loading branch information...
commit 1e8a47afe323cd44a2304ba035fc06c365f1ee0b 1 parent 5f67934
@thatch45 thatch45 authored
Showing with 26 additions and 5 deletions.
  1. +26 −5 salt/overstate.py
View
31 salt/overstate.py
@@ -88,9 +88,7 @@ def _check_result(self, running):
if not running:
return False
for host in running:
- if not 'ret' in running[host]:
- return False
- for tag, ret in running[host]['ret'].items():
+ for tag, ret in running[host].items():
if not 'result' in ret:
return False
if ret['result'] is False:
@@ -111,17 +109,40 @@ def call_stage(self, name, stage):
if 'sls' in stage:
fun = 'state.sls'
arg = (','.join(stage['sls']), self.env)
+ req_fail = {name: {}}
if 'require' in stage:
for req in stage['require']:
if req in self.over_run:
if self._check_result(self.over_run[req]):
continue
else:
- self.over_run[name] = False
+ tag_name = 'req_|-fail_|-fail_|-None'
+ failure = {tag_name: {
+ 'result': False,
+ 'comment': 'Requisite {0} failed for stage'.format(req),
+ 'name': 'Requisite Failure',
+ 'changes': {},
+ '__run_num__': 0,
+ }
+ }
+ self.over_run[name] = failure
+ req_fail[name].update(failure)
elif req not in self.over:
- self.over_run[name] = False
+ tag_name = 'No_|-Req_|-fail_|-None'
+ failure = {tag_name: {
+ 'result': False,
+ 'comment': 'Requisite {0} was not found'.format(req),
+ 'name': 'Requisite Failure',
+ 'changes': {},
+ '__run_num__': 0,
+ }
+ }
+ self.over_run[name] = failure
+ req_fail[name].update(failure)
else:
self.call_stage(self.over[req])
+ if req_fail[name]:
+ return req_fail
ret = {}
tgt = self._stage_list(stage['match'])
for minion in self.local.cmd_iter(
Please sign in to comment.
Something went wrong with that request. Please try again.