Because C.utf8 is not everywhere and is sometimes called C.UTF-8 (just
to confuse people) use en_US.utf8 which is in most places. This isn't
language/region agnostic but gives a consistent unicode aware locale to
devstack.
Change-Id: I67a8c77a5041e9cee740adf0e02fdc9b183c5bc4
fixes-bug: 1697733
| ... | ... |
@@ -27,11 +27,37 @@ set -o xtrace |
| 27 | 27 |
# Make sure custom grep options don't get in the way |
| 28 | 28 |
unset GREP_OPTIONS |
| 29 | 29 |
|
| 30 |
-# Sanitize language settings to avoid commands bailing out |
|
| 31 |
-# with "unsupported locale setting" errors. |
|
| 30 |
+# NOTE(sdague): why do we explicitly set locale when running stack.sh? |
|
| 31 |
+# |
|
| 32 |
+# Devstack is written in bash, and many functions used throughout |
|
| 33 |
+# devstack process text comming off a command (like the ip command) |
|
| 34 |
+# and do transforms using grep, sed, cut, awk on the strings that are |
|
| 35 |
+# returned. Many of these programs are interationalized, which is |
|
| 36 |
+# great for end users, but means that the strings that devstack |
|
| 37 |
+# functions depend upon might not be there in other locales. We thus |
|
| 38 |
+# need to pin the world to an english basis during the runs. |
|
| 39 |
+# |
|
| 40 |
+# Previously we used the C locale for this, every system has it, and |
|
| 41 |
+# it gives us a stable sort order. It does however mean that we |
|
| 42 |
+# effectively drop unicode support.... boo! :( |
|
| 43 |
+# |
|
| 44 |
+# With python3 being more unicode aware by default, that's not the |
|
| 45 |
+# right option. While there is a C.utf8 locale, some distros are |
|
| 46 |
+# shipping it as C.UTF8 for extra confusingness. And it's support |
|
| 47 |
+# isn't super clear across distros. This is made more challenging when |
|
| 48 |
+# trying to support both out of the box distros, and the gate which |
|
| 49 |
+# uses diskimage builder to build disk images in a different way than |
|
| 50 |
+# the distros do. |
|
| 51 |
+# |
|
| 52 |
+# So... en_US.utf8 it is. That's existed for a very long time. It is a |
|
| 53 |
+# compromise position, but it is the least worse idea at the time of |
|
| 54 |
+# this comment. |
|
| 55 |
+# |
|
| 56 |
+# We also have to unset other variables that might impact LC_ALL |
|
| 57 |
+# taking effect. |
|
| 32 | 58 |
unset LANG |
| 33 | 59 |
unset LANGUAGE |
| 34 |
-LC_ALL=C |
|
| 60 |
+LC_ALL=en_US.utf8 |
|
| 35 | 61 |
export LC_ALL |
| 36 | 62 |
|
| 37 | 63 |
# Make sure umask is sane |