add state file name to log line

This commit is contained in:
Andreas Lutro 2016-03-30 15:46:53 +02:00
parent 3c3028f347
commit 72adae3702

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