On Friday, April 26, 2013 at 1:27 AM, " target="_blank"> wrote:
Currently I'm using chef 11 (just upgraded, hoping the problem would go awaybut it hasn't!)So here's my problem.When I type the command "locale" on my ubuntu machine the default output I getis the following:LANG=en_US.UTF-8LANGUAGE=LC_CTYPE="en_US.UTF-8"LC_NUMERIC="en_US.UTF-8"LC_TIME="en_US.UTF-8"LC_COLLATE="en_US.UTF-8"LC_MONETARY="en_US.UTF-8"LC_MESSAGES="en_US.UTF-8"LC_PAPER="en_US.UTF-8"LC_NAME="en_US.UTF-8"LC_ADDRESS="en_US.UTF-8"LC_TELEPHONE="en_US.UTF-8"LC_MEASUREMENT="en_US.UTF-8"LC_IDENTIFICATION="en_US.UTF-8"LC_ALL=Assume that I have a cook book that will write a locale to a temp file in arecipe and cookbookknife node run_list add server1 recipe[writelocale]the following is the contents of the recipe/writelocale.rbexecute "locale" docommand "locale >> /tmp/locale.txt"endThis is a tricky one. The underlying mixlib-shellout library that Chef uses to run commands sets the locale to "C" to avoid encoding issues and get consistent output from localized programs (Chef has to parse output from many commands and this doesn't work if you unexpectedly get Spanish output).This is documented in the code here: https://github.com/opscode/mixlib-shellout/blob/master/lib/mixlib/shellout.rb#L124I think you should be able to add `environment "LC_ALL" => nil` to your execute command to override this.HTH,--Daniel DeLeo
Archive powered by MHonArc 2.6.16.