From 0de1d23895a2966621b4b6eb7cc70e5ed8a93b69 Mon Sep 17 00:00:00 2001 From: Matthew Heler Date: Wed, 17 Oct 2018 15:58:24 -0500 Subject: [PATCH] Fix grep logic around weighting OSDs during ceph-client chart. Change-Id: I7831ac07a53b9aaf3000e9f64bf8c17344723a8f --- ceph-client/templates/bin/pool/_init.sh.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ceph-client/templates/bin/pool/_init.sh.tpl b/ceph-client/templates/bin/pool/_init.sh.tpl index f776b49e3..4b853760b 100644 --- a/ceph-client/templates/bin/pool/_init.sh.tpl +++ b/ceph-client/templates/bin/pool/_init.sh.tpl @@ -39,7 +39,7 @@ fi function reweight_osds () { for OSD_ID in $(ceph --cluster "${CLUSTER}" osd df | awk '$3 == "0" {print $1}'); do - OSD_WEIGHT=$(ceph --cluster "${CLUSTER}" osd df --format json-pretty| grep -A7 osd.${OSD_ID} | awk '/"kb"/{ gsub(",",""); d= $2/1073741824 ; r = sprintf("%.2f", d); print r }'); + OSD_WEIGHT=$(ceph --cluster "${CLUSTER}" osd df --format json-pretty| grep -A7 "\bosd.${OSD_ID}\b" | awk '/"kb"/{ gsub(",",""); d= $2/1073741824 ; r = sprintf("%.2f", d); print r }'); ceph --cluster "${CLUSTER}" osd crush reweight osd.${OSD_ID} ${OSD_WEIGHT}; done }