Otherwise we could successfully add a schedule for a non-rbd
pool, which would become invisible on the next refresh, because
on refresh we loads only rbd pools.
Signed-off-by: Mykola Golub <mgolub@suse.com>
pool_id = handler.module.rados.pool_lookup(pool_name)
if pool_id is None:
raise ValueError("pool {} does not exist".format(pool_name))
+ if pool_id not in get_rbd_pools(handler.module):
+ raise ValueError("{} is not an RBD pool".format(pool_name))
pool_id = str(pool_id)
id += pool_id
if match.group(2) is not None or match.group(3):