Closed jf647 closed 10 years ago
Thank you for your contribution!
I can't see a reason that this one hurts in any way, although I assume that this is not the only warning of this type. I get them all the time, often without having a chance of mitingating them (e.g. when notifying a service to restart that was already enabled in another recipe), this is why I tend to ignore them.
Before I merge this, I want to make sure the tests are adapted too, which is not too big of a task. Unfortunately, atm there are problems with test-kitchen and Berkshelf, preventing them from being run (at least for me) :/
If you have more luck with the tests, let me know.
Just realized that the tests are not affected, they are checking for the created file, which is not related to the resource name.
Thanks!
Because the default policies loop over both tables and chains but the default policy only interpolates the chain name, iptables-ng::install ends up redefining resources over and over.
The warning is detailed in CHEF-3694. Essentially, redefining a resource is easy to do by accident and Opscode wants to discourage the practice of doing so on purpose. Chef 10.18.0 and 11.0.0 and higher emit a warning (which is in this case spurious).
This patch names the default policies using both table and chain name, which means that you don't get two resources with the same name.
I'm not sure how to fit this into a test suite, because the actual iptables output was fine - Chef was just moaning about the redefinition, which only shows up in the Chef log.