Class: Chef::Provider::Ohai

Inherits:
Chef::Provider show all
Defined in:
lib/chef/provider/ohai.rb

Instance Attribute Summary

Attributes inherited from Chef::Provider

#action, #current_resource, #new_resource, #run_context

Instance Method Summary collapse

Methods inherited from Chef::Provider

#action_nothing, build_from_file, #cleanup_after_converge, #converge, #cookbook_name, #define_resource_requirements, #events, #initialize, #node, #process_resource_requirements, #requirements, #resource_collection, #run_action, #whyrun_mode?

Methods included from Mixin::ConvertToClassName

#convert_to_class_name, #convert_to_snake_case, #filename_to_qualified_string, #snake_case_basename

Methods included from Mixin::EnforceOwnershipAndPermissions

#access_controls, #enforce_ownership_and_permissions

Methods included from Mixin::RecipeDefinitionDSLCore

#method_missing

Methods included from Mixin::Language

#data_bag, #data_bag_item, #platform?, #platform_family?, #search, #value_for_platform, #value_for_platform_family

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::Mixin::RecipeDefinitionDSLCore

Instance Method Details

#action_reloadObject


33
34
35
36
37
38
39
40
41
42
43
44
# 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
      ohai.require_plugin @new_resource.plugin
    else
      ohai.all_plugins
    end
    node.automatic_attrs.merge! ohai.data
    Chef::Log.info("#{@new_resource} reloaded")
  end
end

#load_current_resourceObject


29
30
31
# File 'lib/chef/provider/ohai.rb', line 29

def load_current_resource
  true
end

#whyrun_supported?Boolean

Returns:

  • (Boolean)

25
26
27
# File 'lib/chef/provider/ohai.rb', line 25

def whyrun_supported?
  true
end