class Chef::Resource::Locale
def define_resource_requirements
Avoid running this resource on platforms that don't use /etc/locale.conf
def define_resource_requirements requirements.assert(:all_actions) do |a| a.assertion { LOCALE_PLATFORM_FAMILIES.include?(node[:platform_family]) } a.failure_message(Chef::Exceptions::ProviderNotFound, "The locale resource is not supported on platform family: #{node[:platform_family]}") end requirements.assert(:all_actions) do |a| a.assertion do # RHEL/CentOS type platforms don't have locale-gen # Windows has locale-gen as part of the install, but not in the path which("locale-gen") || windows? end a.failure_message(Chef::Exceptions::ProviderNotFound, "The locale resource requires the locale-gen tool") end end