Page MenuHomeDevCentral

replace=False should be explicitly set when no content is provided to file.managed
Closed, ResolvedPublic

Description

Salt uses an implicit replace: False when no content is provided for a file to manage, but expects it to be explicit, hence the following warnings:

$ salt-call --local state.apply roles/viperserv/eggdrop/config test=True
[WARNING ] State for file: /srv/viperserv/logs/Daeghrefn.log - Neither 'source' nor 'contents' nor 'contents_pillar' nor 'contents_grains' was defined, yet 're
place' 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.
[WARNING ] State for file: /srv/viperserv/logs/Wearg.log - Neither 'source' nor 'contents' nor 'contents_pillar' nor 'contents_grains' was defined, yet 'replac
e' 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.
[WARNING ] State for file: /srv/viperserv/logs/TC2.log - 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.