mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Fix test=True for states without changes
If no changes are going to be made, result should be True or False, None is reserved for when changes are going to be made.
This commit is contained in:
parent
78c8190373
commit
5eb941b8fb
@ -57,7 +57,7 @@ def succeed_without_changes(name):
|
|||||||
'comment': 'Success!'
|
'comment': 'Success!'
|
||||||
}
|
}
|
||||||
if __opts__['test']:
|
if __opts__['test']:
|
||||||
ret['result'] = None
|
ret['result'] = True
|
||||||
ret['comment'] = 'If we weren\'t testing, this would be a success!'
|
ret['comment'] = 'If we weren\'t testing, this would be a success!'
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ def fail_without_changes(name):
|
|||||||
}
|
}
|
||||||
|
|
||||||
if __opts__['test']:
|
if __opts__['test']:
|
||||||
ret['result'] = None
|
ret['result'] = False
|
||||||
ret['comment'] = 'If we weren\'t testing, this would be a failure!'
|
ret['comment'] = 'If we weren\'t testing, this would be a failure!'
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
Loading…
Reference in New Issue
Block a user