From 96610abac1c8929edce649fadc9390ec50814351 Mon Sep 17 00:00:00 2001 From: Jaesang Lee Date: Wed, 17 Jan 2018 14:54:15 +0900 Subject: [PATCH] Ceph: fix logic for check ceph version The logic for check ceph version in some charts has a code that doesn't work. This patch check ceph version properly. Change-Id: Ie97a3ec5ac5078f556f59a09db820ee574c60f50 --- ceph/values.yaml | 2 +- cinder/templates/bin/_backup-storage-init.sh.tpl | 2 +- cinder/templates/bin/_storage-init.sh.tpl | 2 +- glance/templates/bin/_storage-init.sh.tpl | 2 +- gnocchi/templates/bin/_storage-init.sh.tpl | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ceph/values.yaml b/ceph/values.yaml index 0350700225..3b98cc848c 100644 --- a/ceph/values.yaml +++ b/ceph/values.yaml @@ -313,7 +313,7 @@ bootstrap: 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} -ne 0 ]]; then + if [[ ${test_luminous} -eq 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 3121f560c6..75b39a6709 100644 --- a/cinder/templates/bin/_backup-storage-init.sh.tpl +++ b/cinder/templates/bin/_backup-storage-init.sh.tpl @@ -35,7 +35,7 @@ elif [ "x$STORAGE_BACKEND" == "xcinder.backup.drivers.ceph" ]; then 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} -ne 0 ]]; then + if [[ ${test_luminous} -eq 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 14b7c67feb..3398d71041 100644 --- a/cinder/templates/bin/_storage-init.sh.tpl +++ b/cinder/templates/bin/_storage-init.sh.tpl @@ -32,7 +32,7 @@ if [ "x$STORAGE_BACKEND" == "xcinder.volume.drivers.rbd.RBDDriver" ]; then 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} -ne 0 ]]; then + if [[ ${test_luminous} -eq 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 80fe765573..895d4b2741 100644 --- a/glance/templates/bin/_storage-init.sh.tpl +++ b/glance/templates/bin/_storage-init.sh.tpl @@ -34,7 +34,7 @@ elif [ "x$STORAGE_BACKEND" == "xrbd" ]; then 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} -ne 0 ]]; then + if [[ ${test_luminous} -eq 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 6c08db0db9..341094689b 100644 --- a/gnocchi/templates/bin/_storage-init.sh.tpl +++ b/gnocchi/templates/bin/_storage-init.sh.tpl @@ -29,7 +29,7 @@ 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} -ne 0 ]]; then + if [[ ${test_luminous} -eq 0 ]]; then ceph osd pool application enable $1 $3 fi }