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:
Mike Place 2016-09-28 11:35:56 +09:00 committed by GitHub
commit b365f1e34d

View file

@ -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)