mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #27467 from cachedout/lint_27375
file.managed: check contents_{pillar|grain} result
This commit is contained in:
commit
382a53403f
1 changed files with 4 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue