Backport https://github.com/opscode/chef/commit/e85f791ece68e43053acfe44...

Replaces https://github.com/opscode/chef/pull/1169

@stevendanna I've ended up doing a very similar thing you've done.