From 7c865effd88e39d1c0e547d5881906b33633ca1f Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 22 Aug 2017 13:55:47 -0400 Subject: [PATCH] qa: add optional 'application' to pool creation helpers Signed-off-by: Casey Bodley --- qa/tasks/util/rados.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/qa/tasks/util/rados.py b/qa/tasks/util/rados.py index 88ee45aa193e3..09388ab38cd52 100644 --- a/qa/tasks/util/rados.py +++ b/qa/tasks/util/rados.py @@ -24,20 +24,28 @@ def rados(ctx, remote, cmd, wait=True, check_status=False): else: return proc -def create_ec_pool(remote, name, profile_name, pgnum, profile={}, cluster_name="ceph"): +def create_ec_pool(remote, name, profile_name, pgnum, profile={}, cluster_name="ceph", application=None): remote.run(args=['sudo', 'ceph'] + cmd_erasure_code_profile(profile_name, profile) + ['--cluster', cluster_name]) remote.run(args=[ 'sudo', 'ceph', 'osd', 'pool', 'create', name, str(pgnum), str(pgnum), 'erasure', profile_name, '--cluster', cluster_name ]) + if application: + remote.run(args=[ + 'sudo', 'ceph', 'osd', 'pool', 'application', 'enable', name, application, '--cluster', cluster_name + ]) -def create_replicated_pool(remote, name, pgnum, cluster_name="ceph"): +def create_replicated_pool(remote, name, pgnum, cluster_name="ceph", application=None): remote.run(args=[ 'sudo', 'ceph', 'osd', 'pool', 'create', name, str(pgnum), str(pgnum), '--cluster', cluster_name ]) + if application: + remote.run(args=[ + 'sudo', 'ceph', 'osd', 'pool', 'application', 'enable', name, application, '--cluster', cluster_name + ]) -def create_cache_pool(remote, base_name, cache_name, pgnum, size, cluster_name="ceph"): +def create_cache_pool(remote, base_name, cache_name, pgnum, size, cluster_name="ceph", application=None): remote.run(args=[ 'sudo', 'ceph', 'osd', 'pool', 'create', cache_name, str(pgnum), '--cluster', cluster_name ]) @@ -45,6 +53,10 @@ def create_cache_pool(remote, base_name, cache_name, pgnum, size, cluster_name=" 'sudo', 'ceph', 'osd', 'tier', 'add-cache', base_name, cache_name, str(size), '--cluster', cluster_name ]) + if application: + remote.run(args=[ + 'sudo', 'ceph', 'osd', 'pool', 'application', 'enable', name, application, '--cluster', cluster_name + ]) def cmd_erasure_code_profile(profile_name, profile): """ -- 2.39.5