file.managed: check contents_{pillar|grain} result

Fixes #27342.
This commit is contained in:
Justin Findlay 2015-09-24 12:04:15 -06:00
parent c2efb291e2
commit 278ade52d2

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_grain))
# ensure contents is a string
if contents: