opscode-cookbooks/ntp — pull request #41 by vtolstov (2013-12-13 06:44:05+00:00)
Title: add check for existanse of node["virtualization"]

Sometimes users need to disable some plugins in ohai, in my case
i need to disable virtualization plugin and recipe fails like:

Generated at 2013-12-13 10:34:19 +0400
Chef::Mixin::Template::TemplateError:

Chef::Mixin::Template::TemplateError (undefined method `[]' for nil:NilClass) on line #4:

2: # Local modifications will be overwritten.
3: <%# See http://www.vmware.com/vmtn/resources/238 p. 23 for explanation %>
4: <% if node['virtualization']['role'] == "guest" -%>
5: tinker panic 0
6: <% end -%>

Signed-off-by: Vasiliy Tolstov