Merge pull request #27467 from cachedout/lint_27375

file.managed: check contents_{pillar|grain} result
This commit is contained in:
Mike Place 2015-09-28 14:22:16 -06:00
commit 382a53403f

View file

@ -1364,8 +1364,12 @@ def managed(name,
if contents_pillar:
contents = __salt__['pillar.get'](contents_pillar)
if not contents:
return _error(ret, 'contents_pillar {0} results in empty contents'.format(contents_pillar))
if contents_grains:
contents = __salt__['grains.get'](contents_grains)
if not contents:
return _error(ret, 'contents_grain {0} results in empty contents'.format(contents_grains))
# ensure contents is a string
if contents: