opscode/ohai — pull request #248 by danielsdeleo (2013-12-19 21:02:01+00:00)
Title: Pass user-requested attributes from CLI to whitelist

This greatly speeds up running ohai from the command line when given a
set of attributes to display (like `ohai ec2`). Prior to this patch,
ohai would run all plugins and then filter out the data. With this
patch, ohai only runs relevant plugins.

As an unscientific test `bin/ohai network` on my laptop takes ~4s
without this patch compared to ~1.1s with the patch.

Note that the `Ohai::Application` class doesn't have any tests at the moment, but I verified the behavior in the following cases:

* simple one-level attribute: `ohai network`
* multi-level attribute: `ohai network/interfaces`
* multiple attributes: `ohai network kernel`