mirror of
https://github.com/ceph/ceph
synced 2025-02-22 10:37:15 +00:00
Merge pull request #32519 from tchaikov/wip-qa-skip-if-no-pool
qa/tasks/ceph_manager: do not pick a pool is there is no pools Reviewed-By: Neha Ojha <nojha@redhat.com>
This commit is contained in:
commit
14a138e676
@ -666,6 +666,8 @@ class OSDThrasher(Thrasher):
|
||||
Increase the size of the pool
|
||||
"""
|
||||
pool = self.ceph_manager.get_pool()
|
||||
if pool is None:
|
||||
return
|
||||
self.log("Growing pool %s" % (pool,))
|
||||
if self.ceph_manager.expand_pool(pool,
|
||||
self.config.get('pool_grow_by', 10),
|
||||
@ -677,6 +679,8 @@ class OSDThrasher(Thrasher):
|
||||
Decrease the size of the pool
|
||||
"""
|
||||
pool = self.ceph_manager.get_pool()
|
||||
if pool is None:
|
||||
return
|
||||
_ = self.ceph_manager.get_pool_pg_num(pool)
|
||||
self.log("Shrinking pool %s" % (pool,))
|
||||
if self.ceph_manager.contract_pool(
|
||||
@ -1877,7 +1881,8 @@ class CephManager:
|
||||
Pick a random pool
|
||||
"""
|
||||
with self.lock:
|
||||
return random.choice(self.pools.keys())
|
||||
if self.pools:
|
||||
return random.choice(self.pools.keys())
|
||||
|
||||
def get_pool_pg_num(self, pool_name):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user