From 92171b04926f13a2dfe564a2545dff022baa0249 Mon Sep 17 00:00:00 2001 From: Arif Ali Date: Fri, 1 Jul 2022 20:32:35 +0100 Subject: [PATCH] Fix bashisms in fix_cloud.sh --- fix_cloud.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fix_cloud.sh b/fix_cloud.sh index c45ec27..1b349fd 100755 --- a/fix_cloud.sh +++ b/fix_cloud.sh @@ -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@*'