From 6099a04e414d521fba6134c012ed9d7e7a8e6e28 Mon Sep 17 00:00:00 2001 From: Wes Date: Tue, 28 Mar 2023 16:04:54 +0000 Subject: [PATCH] Change how the size is determined, in case there a decimal value is provided --- salt/common/tools/sbin/so-elasticsearch-cluster-space-total | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/common/tools/sbin/so-elasticsearch-cluster-space-total b/salt/common/tools/sbin/so-elasticsearch-cluster-space-total index 57360d505..3faa2a7a9 100755 --- a/salt/common/tools/sbin/so-elasticsearch-cluster-space-total +++ b/salt/common/tools/sbin/so-elasticsearch-cluster-space-total @@ -44,7 +44,7 @@ for i in $(/usr/sbin/so-elasticsearch-query _cat/allocation | grep -v {{ GLOBALS {% else %} for i in $(/usr/sbin/so-elasticsearch-query _cat/allocation | awk '{print $5}'); do {% endif %} - size=$(echo $i | grep -oE '[0-9]+') + size=$(echo $i | grep -oE '[0-9].*' | awk '{print int($1+0.5)}') unit=$(echo $i | grep -oE '[A-Za-z]+') if [ $unit = "tb" ]; then size=$(( size * 1024 ))