mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #36613 from slinn0/2016.3_36588_fixes
Remove file.check_managed_changes when not needed (backport of PR #36589 to 2016.3)
This commit is contained in:
commit
b365f1e34d
1 changed files with 16 additions and 18 deletions
|
@ -1627,24 +1627,6 @@ def managed(name,
|
|||
if not context:
|
||||
context = {}
|
||||
context['accumulator'] = accum_data[name]
|
||||
if 'file.check_managed_changes' in __salt__:
|
||||
ret['pchanges'] = __salt__['file.check_managed_changes'](
|
||||
name,
|
||||
source,
|
||||
source_hash,
|
||||
user,
|
||||
group,
|
||||
mode,
|
||||
template,
|
||||
context,
|
||||
defaults,
|
||||
__env__,
|
||||
contents,
|
||||
skip_verify,
|
||||
**kwargs
|
||||
)
|
||||
else:
|
||||
ret['pchanges'] = {}
|
||||
|
||||
if show_diff is not None:
|
||||
show_changes = show_diff
|
||||
|
@ -1656,6 +1638,22 @@ def managed(name,
|
|||
|
||||
try:
|
||||
if __opts__['test']:
|
||||
if 'file.check_managed_changes' in __salt__:
|
||||
ret['pchanges'] = __salt__['file.check_managed_changes'](
|
||||
name,
|
||||
source,
|
||||
source_hash,
|
||||
user,
|
||||
group,
|
||||
mode,
|
||||
template,
|
||||
context,
|
||||
defaults,
|
||||
__env__,
|
||||
contents,
|
||||
skip_verify,
|
||||
**kwargs
|
||||
)
|
||||
if ret['pchanges']:
|
||||
ret['result'] = None
|
||||
ret['comment'] = 'The file {0} is set to be changed'.format(name)
|
||||
|
|
Loading…
Add table
Reference in a new issue