Fix ceph version check error in jewel version.

In a jewel version, egrep -c "12.2|luminous" returns "0",
but execution will be error.
So, add pipe and echo command to make a success.

Change-Id: I94f45855f6510e747884d8b6a629a62c3d96adbd
This commit is contained in:
Seungkyu Ahn 2018-07-26 16:15:57 +09:00
parent 71439d1b67
commit 8d709b31a9
8 changed files with 8 additions and 8 deletions

View File

@ -380,7 +380,7 @@ bootstrap:
ceph -s
function ensure_pool () {
ceph osd pool stats $1 || ceph osd pool create $1 $2
local test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous")
local test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous" | xargs echo)
if [[ ${test_luminous} -gt 0 ]]; then
ceph osd pool application enable $1 $3
fi

View File

@ -238,7 +238,7 @@ bootstrap:
ceph -s
function ensure_pool () {
ceph osd pool stats $1 || ceph osd pool create $1 $2
local test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous")
local test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous" | xargs echo)
if [[ ${test_luminous} -gt 0 ]]; then
ceph osd pool application enable $1 $3
fi

View File

@ -198,7 +198,7 @@ bootstrap:
ceph -s
function ensure_pool () {
ceph osd pool stats $1 || ceph osd pool create $1 $2
local test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous")
local test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous" | xargs echo)
if [[ ${test_luminous} -gt 0 ]]; then
ceph osd pool application enable $1 $3
fi

View File

@ -161,7 +161,7 @@ bootstrap:
ceph -s
function ensure_pool () {
ceph osd pool stats $1 || ceph osd pool create $1 $2
local test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous")
local test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous" | xargs echo)
if [[ ${test_luminous} -gt 0 ]]; then
ceph osd pool application enable $1 $3
fi

View File

@ -34,7 +34,7 @@ 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 tell osd.* version | egrep -c "12.2|luminous")
local test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous" | xargs echo)
if [[ ${test_luminous} -gt 0 ]]; then
ceph osd pool application enable $1 $3
fi

View File

@ -31,7 +31,7 @@ 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 tell osd.* version | egrep -c "12.2|luminous")
local test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous" | xargs echo)
if [[ ${test_luminous} -gt 0 ]]; then
ceph osd pool application enable $1 $3
fi

View File

@ -43,7 +43,7 @@ elif [ "x$STORAGE_BACKEND" == "xrbd" ]; then
function ensure_pool () {
ceph osd pool stats "$1" || ceph osd pool create "$1" "$2"
local test_luminous
test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous")
test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous" | xargs echo)
if [[ ${test_luminous} -gt 0 ]]; then
ceph osd pool application enable "$1" "$3"
fi

View File

@ -28,7 +28,7 @@ set -ex
ceph -s
function ensure_pool () {
ceph osd pool stats $1 || ceph osd pool create $1 $2
local test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous")
local test_luminous=$(ceph tell osd.* version | egrep -c "12.2|luminous" | xargs echo)
if [[ ${test_luminous} -gt 0 ]]; then
ceph osd pool application enable $1 $3
fi