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:
parent
71439d1b67
commit
8d709b31a9
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user