summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-04-16 10:19:40 +0000
committerGerrit Code Review <review@openstack.org>2020-04-16 10:19:40 +0000
commit81fab723da125586766e2b25bd4e655bcaec2108 (patch)
tree6bb2bcf6bf1aa8b2d9a45c8ef26b16e5c58c1749
parentbdb9d799b4a0ea61fe5c294173e81bd21c1afecc (diff)
parent44ef591464d03960d0bc8c322cacbb97a44968fe (diff)
downloadkolla-81fab723da125586766e2b25bd4e655bcaec2108.tar.gz
kolla-81fab723da125586766e2b25bd4e655bcaec2108.zip
Merge "Ensure proper JSON in keystone bootstrap" into stable/train
-rw-r--r--docker/keystone/keystone/keystone_bootstrap.sh4
-rw-r--r--releasenotes/notes/bug-1866017-9e31ddbfca9fd0f4.yaml5
2 files changed, 8 insertions, 1 deletions
diff --git a/docker/keystone/keystone/keystone_bootstrap.sh b/docker/keystone/keystone/keystone_bootstrap.sh
index e37e38352..15a79c3eb 100644
--- a/docker/keystone/keystone/keystone_bootstrap.sh
+++ b/docker/keystone/keystone/keystone_bootstrap.sh
@@ -33,7 +33,9 @@ function exit_json {
changed="false"
# 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)
+# NOTE(yoctozepto): also apply sed to escape double quotation marks
+# and backslashes
+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 | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')
if [[ $? != 0 ]]; then
fail_json "${keystone_bootstrap}"
fi
diff --git a/releasenotes/notes/bug-1866017-9e31ddbfca9fd0f4.yaml b/releasenotes/notes/bug-1866017-9e31ddbfca9fd0f4.yaml
new file mode 100644
index 000000000..264a56b3e
--- /dev/null
+++ b/releasenotes/notes/bug-1866017-9e31ddbfca9fd0f4.yaml
@@ -0,0 +1,5 @@
+---
+fixes:
+ - |
+ Keystone bootstrap could produce invalid json.
+ `LP#1866017 <https://launchpad.net/bugs/1866017>`__