Method: Chef::Resource#action_description

Defined in:
lib/chef/resource.rb

#action_description(action) ⇒ Object

Retrieve the description for a resource’s action, if any description has been included in the definition.

was defined

Parameters:

Returns:

  • the description of the action provided, or nil if no description



1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
# File 'lib/chef/resource.rb', line 1093

def action_description(action)
  provider_for_action(action).class.action_description(action)
rescue Chef::Exceptions::ProviderNotFound
  # If a provider can't be found, there can be no description defined on the provider.
  nil
rescue NameError => e
  # This can happen when attempting to load a provider in a platform-specific
  # environment where we have not required the necessary files yet
  raise unless /uninitialized constant/.match?(e.message)
end