Deprecation: Deprecation of lc_all from locale resource (CHEF-27)

[edit on GitHub]

Setting the LC_ALL variable is NOT recommended. As a system-wide setting, LANG should provide the desired behavior. LC_ALL is intended to be used for temporarily troubleshooting issues rather than an everyday system setting. Changing LC_ALL can break Chef’s parsing of command output in unexpected ways. Use one of the more specific LC_ properties as needed. This deprecation warning was added in Chef Infra Client 15.0. Support for property lc_all will be removed for Chef Infra Client 16.0.

The Cookstyle cop ChefDeprecations/LocaleDeprecatedLcAllProperty has been introduced to detect and autocorrect this deprecation.

Remediation

Set LC_ALL in current shell as:

export LC_ALL="<locale_name>"

To check the locale value, run:

locale -v

You can also use file Resource and add this variable in any other file of your choice and then can source that file to reflect changes.

file "<path_to_file>" do
  content "LC_ALL=<locale_name>"
end

Where path_to_file could be any one of:

  1. /etc/default/locale
  2. /etc/sysconfig/i18n
  3. /etc/environment

Setting **LC_** variables varies by platform, but these are the common locations to configure **LC_** variables.

Warning

Using the file Resource or other manual management method of LC configuration may overwrite settings from this resource and break your system.

© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/deprecations_locale_lc_all/