Fix 'unsupported locale setting' errors in init-runonce

Keystone requires a valid LC_ALL environment variable to be set, if left
empty the following output is shown:

"""
$ tools/init-runonce
Downloading glance image.
Creating glance image.
[=============================>] 100%
<snip>
Configuring neutron.
unsupported locale setting
unsupported locale setting
unsupported locale setting
unsupported locale setting
unsupported locale setting
unsupported locale setting
unsupported locale setting
unsupported locale setting
unsupported locale setting
unsupported locale setting
unsupported locale setting
Could not find any suitable endpoint. Correct region?
<snip>
"""

A similar problem occurred in devstack
(https://bugs.launchpad.net/devstack/+bug/1249131), apply the same patch
they use to to sanitize language settings
(https://github.com/openstack-dev/devstack/blob/master/stack.sh#L27).

Closes-Bug: #1466548

Change-Id: I8e86a4466181d6dd1c1749915c1c43521af805b7
This commit is contained in:
Paul Bourke 2015-06-04 15:33:30 +00:00
parent c2b05b576f
commit 018a07984a

View File

@ -5,6 +5,13 @@
# configures networking and nova quotas to allow 40 m1.small instances # configures networking and nova quotas to allow 40 m1.small instances
# to be created. # to be created.
# Sanitize language settings to avoid commands bailing out
# with "unsupported locale setting" errors.
unset LANG
unset LANGUAGE
LC_ALL=C
export LC_ALL
# Move to top level directory # Move to top level directory
REAL_PATH=$(python -c "import os,sys;print os.path.realpath('$0')") REAL_PATH=$(python -c "import os,sys;print os.path.realpath('$0')")
cd "$(dirname "$REAL_PATH")/.." cd "$(dirname "$REAL_PATH")/.."