customink-webops / hostsfile

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

hostsfile_entry resource always sends notifies #55

Closed timurb closed 10 years ago

timurb commented 10 years ago

hostsfile_entry resource always send notifies even when no action is taken:

  * file[/etc/hosts] action create (up to date)

    - Append hostsfile_entry[localhost]

This is caused by construction like https://github.com/customink-webops/hostsfile/blob/master/providers/entry.rb#L34-L44 which does not look like it is correct: converge_by is used for better support on why_runs (if I got that correctly from docs) while the File resource used to create the /etc/hosts supports that by itself.

Opscode also says that this kind of usage of converge_by is incorrect: you first need to decide if you need to update the resource and run converge block only after that.

sethvargo commented 10 years ago

Thank you for the report. I would gladly review a PR to fix this functionality.