Fix lspool issues on Mimic

With the Mimic release they have changed
the output of the "ceph osd lspools" command.

The old output (from Luminous):
$ceph osd lspools
5 glance,6 gnocchi,13 cinder,25 nova,

The new output (from Mimic):
$ceph osd lspools
1 glance
2 nova
3 cinder
4 gnocchi

This changes the usage of "ceph osd lspools"
to "ceph osd pool ls" which exists in both
versions and has the same output.

Example output of "ceph osd pool ls"
$ceph osd pool ls
glance
nova
cinder
gnocchi

We combine this with a grep with word-regexp
which will make sure we do a fullmatch on the
name of the pools.

Change-Id: I8883c8400ffc18672479fe2ad8cc7955a52bc466
This commit is contained in:
Tobias Urdin 2018-06-18 22:12:15 +02:00
parent e6c31c4659
commit 72235f18aa
1 changed files with 2 additions and 2 deletions

View File

@ -66,7 +66,7 @@ set -ex
ceph osd pool create ${name} ${pg_num}",
unless => "/bin/true # comment to satisfy puppet syntax requirements
set -ex
ceph osd lspools | grep ' ${name},'",
ceph osd pool ls | grep -w '${name}'",
timeout => $exec_timeout,
}
@ -115,7 +115,7 @@ set -ex
ceph osd pool delete ${name} ${name} --yes-i-really-really-mean-it",
onlyif => "/bin/true # comment to satisfy puppet syntax requirements
set -ex
ceph osd lspools | grep ${name}",
ceph osd pool ls | grep -w '${name}'",
timeout => $exec_timeout,
} -> Ceph::Mon<| ensure == absent |>