file.managed calculates changes twice on normal runs
Description of Issue
file.managed renders jinja and calculates the diffs between existing file and source file twice. This is suboptimal and file.check_managed_changes should only run when test=True
Setup
Was running a file.managed with a jinja template and noticed that jinja templating was being called twice for every file.managed.
Steps to Reproduce Issue
Make a file.managed with a jinja template and have the jinja code log something and notice it is called twice.
Versions Report
Noticed bug appeared when upgrading from 2015.8 to 2016.3. Verified bug exists in todays develop branch. I have a fix for develop and 2016.3. Will make a PR shortly.
@slinn0 Thanks for sending this and for sending a fix along with it. We love it when that happens. :+1:
@cachedout,
I tried to cherry pick this fix into 2016.3 which is the branch we are using and there are conflicts because of changes in surrounding code. I have a fix for 2016.3 that is tested. Should I make a PR against 2016.3 too?
@slinn0 That would be great!