Fix bashisms in fix_cloud.sh

This commit is contained in:
Arif Ali 2022-07-01 20:32:35 +01:00
parent 4ee03a9887
commit 92171b0492
Signed by: arif
GPG Key ID: 369608FBA1353A70

View File

@ -33,7 +33,7 @@ get_lead()
{
app_name=$1
jq -rc ".applications.${app_name}.units | to_entries[] | select(.value.leader == "true") | .key" "${juju_status}"
jq -rc '.applications.${app_name}.units | to_entries[] | select(.value.leader == "true") | .key' "${juju_status}"
}
do_vault()
@ -84,7 +84,7 @@ if [[ -n "${percona_cluster}" ]] ; then
safe_to_bootstrap=$(echo "$mysql_status" | jq -rc . | grep "Safe To Bootstrap: 1" | jq -r .sub)
if [[ -n "$safe_to_bootstrap" ]]
then
then
bootstrap_unit=$safe_to_bootstrap
@ -159,7 +159,7 @@ if [[ -n "${mysql_innodb_cluster}" ]] ; then
if [[ -z "${is_ready}" ]] ; then
reboot_status=$(juju run-action mysql-innodb-cluster/leader reboot-cluster-from-complete-outage --wait --format json)
outcome=$(echo "$reboot_status" | jq .[].results.outcome)
if [[ ${outcome} == null ]] ; then
@ -199,7 +199,6 @@ juju run --all -- sudo systemctl restart systemd-resolved
ceph_osd_apps=$(jq -rc ".applications | to_entries[] | select(.value[\"charm-name\"] == \"ceph-osd\") | .key" "${juju_status}")
ceph_osds=""
for apps in ${ceph_osd_apps}
do
juju run -a "${apps}" --timeout 30s -- 'sudo systemctl kill --all --type=service vaultlocker-decrypt@*'