summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2019-12-09 22:14:22 +0000
committerGerrit Code Review <review@openstack.org>2019-12-09 22:14:22 +0000
commit5ef72d632881dfb07e622abe0da3304f6c25d83c (patch)
treea7b40a36c590e338492dcc3d091e3e80f068d949 /docker
parentb8c743092ca873543b44794489c62e9c8d2e2d80 (diff)
parent17b16cde7a38f56052f4397fbd707c33b2af0555 (diff)
downloadkolla-5ef72d632881dfb07e622abe0da3304f6c25d83c.tar.gz
kolla-5ef72d632881dfb07e622abe0da3304f6c25d83c.zip
Merge "Fix keystone bootstrap error message display" into stable/train
Diffstat (limited to 'docker')
-rw-r--r--docker/keystone/keystone/keystone_bootstrap.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/docker/keystone/keystone/keystone_bootstrap.sh b/docker/keystone/keystone/keystone_bootstrap.sh
index c140e97c7..e37e38352 100644
--- a/docker/keystone/keystone/keystone_bootstrap.sh
+++ b/docker/keystone/keystone/keystone_bootstrap.sh
@@ -1,5 +1,7 @@
#!/bin/bash
+set -o pipefail
+
# NOTE(SamYaple): Kolla needs to wraps `keystone-manage bootstrap` to ensure
# any change is reported correctly for idempotency. This script will exit with
# valid json that can be parsed with information about if the task has failed
@@ -29,7 +31,9 @@ function exit_json {
}
changed="false"
-keystone_bootstrap=$(keystone-manage bootstrap --bootstrap-username "${USERNAME}" --bootstrap-password "${PASSWORD}" --bootstrap-project-name "${PROJECT}" --bootstrap-role-name "${ROLE}" --bootstrap-admin-url "${ADMIN_URL}" --bootstrap-internal-url "${INTERNAL_URL}" --bootstrap-public-url "${PUBLIC_URL}" --bootstrap-service-name "keystone" --bootstrap-region-id "${REGION}" 2>&1)
+# NOTE(mgoddard): pipe through cat -v to remove unprintable control characters
+# which prevent JSON decoding.
+keystone_bootstrap=$(keystone-manage bootstrap --bootstrap-username "${USERNAME}" --bootstrap-password "${PASSWORD}" --bootstrap-project-name "${PROJECT}" --bootstrap-role-name "${ROLE}" --bootstrap-admin-url "${ADMIN_URL}" --bootstrap-internal-url "${INTERNAL_URL}" --bootstrap-public-url "${PUBLIC_URL}" --bootstrap-service-name "keystone" --bootstrap-region-id "${REGION}" 2>&1 | cat -v)
if [[ $? != 0 ]]; then
fail_json "${keystone_bootstrap}"
fi