From d361c8f3030a02e437f935e666f6e151398213fa Mon Sep 17 00:00:00 2001 From: Seungkyu Ahn Date: Thu, 25 Jan 2018 17:27:53 +0900 Subject: [PATCH] Change the check method for the ceph ods version Previously, the ceph version was checked with "ceph -v". However, this way is only check for the ceph client version. So I change the way to check the ceph osd version. Change-Id: I11f44186f671594e6e9e848f3fddb1d23b994b36 --- ceph/values.yaml | 4 ++-- cinder/templates/bin/_backup-storage-init.sh.tpl | 4 ++-- cinder/templates/bin/_storage-init.sh.tpl | 4 ++-- glance/templates/bin/_storage-init.sh.tpl | 4 ++-- gnocchi/templates/bin/_storage-init.sh.tpl | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ceph/values.yaml b/ceph/values.yaml index 64d9500091..6e60c9c288 100644 --- a/ceph/values.yaml +++ b/ceph/values.yaml @@ -314,8 +314,8 @@ bootstrap: ceph -s function ensure_pool () { ceph osd pool stats $1 || ceph osd pool create $1 $2 - local test_luminous=$(ceph -v | egrep -q "12.2|luminous"; echo $?) - if [[ ${test_luminous} -eq 0 ]]; then + local test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous") + if [[ ${test_luminous} -gt 0 ]]; then ceph osd pool application enable $1 $3 fi } diff --git a/cinder/templates/bin/_backup-storage-init.sh.tpl b/cinder/templates/bin/_backup-storage-init.sh.tpl index 239aa8c650..3d8214b542 100644 --- a/cinder/templates/bin/_backup-storage-init.sh.tpl +++ b/cinder/templates/bin/_backup-storage-init.sh.tpl @@ -34,8 +34,8 @@ elif [ "x$STORAGE_BACKEND" == "xcinder.backup.drivers.ceph" ]; then ceph -s function ensure_pool () { ceph osd pool stats $1 || ceph osd pool create $1 $2 - local test_luminous=$(ceph -v | egrep -q "12.2|luminous"; echo $?) - if [[ ${test_luminous} -eq 0 ]]; then + local test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous") + if [[ ${test_luminous} -gt 0 ]]; then ceph osd pool application enable $1 $3 fi } diff --git a/cinder/templates/bin/_storage-init.sh.tpl b/cinder/templates/bin/_storage-init.sh.tpl index 1a4b11c2a3..76a4de46bb 100644 --- a/cinder/templates/bin/_storage-init.sh.tpl +++ b/cinder/templates/bin/_storage-init.sh.tpl @@ -31,8 +31,8 @@ if [ "x$STORAGE_BACKEND" == "xcinder.volume.drivers.rbd.RBDDriver" ]; then ceph -s function ensure_pool () { ceph osd pool stats $1 || ceph osd pool create $1 $2 - local test_luminous=$(ceph -v | egrep -q "12.2|luminous"; echo $?) - if [[ ${test_luminous} -eq 0 ]]; then + local test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous") + if [[ ${test_luminous} -gt 0 ]]; then ceph osd pool application enable $1 $3 fi } diff --git a/glance/templates/bin/_storage-init.sh.tpl b/glance/templates/bin/_storage-init.sh.tpl index ea57b49e47..a4a0609040 100644 --- a/glance/templates/bin/_storage-init.sh.tpl +++ b/glance/templates/bin/_storage-init.sh.tpl @@ -33,8 +33,8 @@ elif [ "x$STORAGE_BACKEND" == "xrbd" ]; then ceph -s function ensure_pool () { ceph osd pool stats $1 || ceph osd pool create $1 $2 - local test_luminous=$(ceph -v | egrep -q "12.2|luminous"; echo $?) - if [[ ${test_luminous} -eq 0 ]]; then + local test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous") + if [[ ${test_luminous} -gt 0 ]]; then ceph osd pool application enable $1 $3 fi } diff --git a/gnocchi/templates/bin/_storage-init.sh.tpl b/gnocchi/templates/bin/_storage-init.sh.tpl index e25eb0c172..6eb9f72bf7 100644 --- a/gnocchi/templates/bin/_storage-init.sh.tpl +++ b/gnocchi/templates/bin/_storage-init.sh.tpl @@ -28,8 +28,8 @@ set -ex ceph -s function ensure_pool () { ceph osd pool stats $1 || ceph osd pool create $1 $2 - local test_luminous=$(ceph -v | egrep -q "12.2|luminous"; echo $?) - if [[ ${test_luminous} -eq 0 ]]; then + local test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous") + if [[ ${test_luminous} -gt 0 ]]; then ceph osd pool application enable $1 $3 fi }