mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Avoid confusing warning when using file.line
file.line is internaly using file.managed without any source argument to ensure file creation with the appropriate permissions. file.managed has its 'replace' parameter defaulting to True, resulting in the following warning : Neither 'source' nor 'contents' nor 'contents_pillar' nor 'contents_grains' was defined, yet 'replace' was set to 'True'. As there is no source to replace the file with, 'replace' has been set to 'False' to avoid reading the file unnecessarily. Setting explicitly replace to False solve this issue. Signed-off-by: Marin Hannache <marin@cri.epita.net>
This commit is contained in:
parent
50c1635dcc
commit
2fd172e07b
1 changed files with 7 additions and 1 deletions
|
@ -3732,7 +3732,13 @@ def line(name, content=None, match=None, mode=None, location=None,
|
|||
if not name:
|
||||
return _error(ret, 'Must provide name to file.line')
|
||||
|
||||
managed(name, create=create, user=user, group=group, mode=file_mode)
|
||||
managed(
|
||||
name,
|
||||
create=create,
|
||||
user=user,
|
||||
group=group,
|
||||
mode=file_mode,
|
||||
replace=False)
|
||||
|
||||
check_res, check_msg = _check_file(name)
|
||||
if not check_res:
|
||||
|
|
Loading…
Add table
Reference in a new issue