From 018a07984aacfccea28990aec5367e570f74a4c5 Mon Sep 17 00:00:00 2001
From: Paul Bourke <paul.bourke@oracle.com>
Date: Thu, 4 Jun 2015 15:33:30 +0000
Subject: [PATCH] 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
---
 tools/init-runonce | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/init-runonce b/tools/init-runonce
index 25d05cf61b..1cc8463929 100755
--- a/tools/init-runonce
+++ b/tools/init-runonce
@@ -5,6 +5,13 @@
 # configures networking and nova quotas to allow 40 m1.small instances
 # 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
 REAL_PATH=$(python -c "import os,sys;print os.path.realpath('$0')")
 cd "$(dirname "$REAL_PATH")/.."
-- 
GitLab