customink-webops / hostsfile

Easily manage your hosts file with Chef
Apache License 2.0
155 stars 82 forks source link

Attempt to eliminate sending unnecessary notifies #56

Closed bdclark closed 10 years ago

bdclark commented 10 years ago

This PR attempts to eliminate unnecessary notifications when hostsfile content does not change. I made converge_by conditional on a number of LWRP actions by adding a content_changed? method to the manipulator. Moved final hostsfile content generation from the save method to its own method(s) so the new hostsfile contents can be sha-compared to the current hostsfile contents before saving.

My ruby-fu (and chef, and rspec, etc.) is somewhat lacking, so please advise if I'm taking the wrong approach or if this PR needs tuning. Should handle issue #55, and definitely helps in another dependent cookbook I'm using.