Noticed the provides_map would contain multiple copies of the same plugin under attr[:_plugins]. This changes the provides_map so that it saves only one copy of a plugin in attr[:_plugins].
collect only unique providers
I thought I'd solved this problem by modifying the plugin loader code to build the dependency map in one go and then instantiate all the plugins. Do you have more info on how this situation occurs?
OK I just figured out what's really going on with this...
Once all the plugin classes have been loaded, @v7_plugin_classes contains each unique plugin class. Looking at the CPU plugin shows Ohai::NamedPlugin::CPU.provides_attrs = ["cpu", "cpu", "cpu", ... "cpu"], one for each file that declares provides "cpu", 9 total.
Ohai::NamedPlugin::CPU.provides_attrs = ["cpu", "cpu", "cpu", ... "cpu"]
We need to do a uniq over the provided attributes. I can put that in.
revert provides_map changes, ensure provides and depends only collect…
… unique attributes
OK this should do it. @danielsdeleo
Looks good to me.