Class: Chef::Provider::Ohai
- Inherits:
-
Chef::Provider
- Object
- Chef::Provider
- Chef::Provider::Ohai
- Defined in:
- lib/chef/provider/ohai.rb
Instance Attribute Summary
Attributes inherited from Chef::Provider
#action, #cookbook_name, #current_resource, #new_resource, #recipe_name, #run_context
Instance Method Summary collapse
Methods inherited from Chef::Provider
#action_nothing, #cleanup_after_converge, #converge_by, #define_resource_requirements, #events, #initialize, #node, #process_resource_requirements, #requirements, #resource_collection, #resource_updated?, #run_action, #set_updated_status, #whyrun_mode?
Methods included from DSL::Recipe
#build_resource, #declare_resource, #describe_self_for_error, #evaluate_resource_definition, #has_resource_definition?, #have_resource_class_for?, #method_missing, #resource_class_for
Methods included from Mixin::ConvertToClassName
#convert_to_class_name, #convert_to_snake_case, #filename_to_qualified_string, #snake_case_basename
Constructor Details
This class inherits a constructor from Chef::Provider
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Chef::DSL::Recipe
Instance Method Details
#action_reload ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/chef/provider/ohai.rb', line 33 def action_reload converge_by("re-run ohai and merge results into node attributes") do ohai = ::Ohai::System.new # If @new_resource.plugin is nil, ohai will reload all the plugins # Otherwise it will only reload the specified plugin # Note that any changes to plugins, or new plugins placed on # the path are picked up by ohai. ohai.all_plugins @new_resource.plugin node.automatic_attrs.merge! ohai.data Chef::Log.info("#{@new_resource} reloaded") end end |
#load_current_resource ⇒ Object
29 30 31 |
# File 'lib/chef/provider/ohai.rb', line 29 def load_current_resource true end |
#whyrun_supported? ⇒ Boolean
25 26 27 |
# File 'lib/chef/provider/ohai.rb', line 25 def whyrun_supported? true end |