Merge pull request #32239 from alprs/fix-file_log_warning

Add state file name to warning log line
This commit is contained in:
Mike Place 2016-03-30 08:37:54 -06:00
commit 7fce438b67

View file

@ -1416,11 +1416,11 @@ def managed(name,
if not source and contents_count == 0 and replace:
replace = False
log.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.'
'State for file: {0} - 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.'.format(name)
)
# Use this below to avoid multiple '\0' checks and save some CPU cycles