qa/cephfs: move the cephfs's opertions setting to create()

Fixes: https://tracker.ceph.com/issues/47565
Signed-off-by: Xiubo Li <xiubli@redhat.com>
This commit is contained in:
Xiubo Li 2020-10-12 10:13:43 +08:00
parent 3b5303482f
commit cb8081ce7f
2 changed files with 9 additions and 8 deletions

View File

@ -428,13 +428,8 @@ def cephfs_setup(ctx, config):
if mdss.remotes:
log.info('Setting up CephFS filesystem...')
fs = Filesystem(ctx, name='cephfs', create=True,
ec_profile=config.get('cephfs_ec_profile', None))
cephfs_conf = config['cephfs']
max_mds = config_conf.get('max_mds', 1)
if max_mds > 1:
fs.set_max_mds(max_mds)
Filesystem(ctx, fs_config=config.get('cephfs', None), name='cephfs',
create=True, ec_profile=config.get('cephfs_ec_profile', None))
yield

View File

@ -452,7 +452,7 @@ class Filesystem(MDSCluster):
This object is for driving a CephFS filesystem. The MDS daemons driven by
MDSCluster may be shared with other Filesystems.
"""
def __init__(self, ctx, fscid=None, name=None, create=False,
def __init__(self, ctx, fs_config=None, fscid=None, name=None, create=False,
ec_profile=None):
super(Filesystem, self).__init__(ctx)
@ -463,6 +463,7 @@ class Filesystem(MDSCluster):
self.metadata_overlay = False
self.data_pool_name = None
self.data_pools = None
self.fs_config = fs_config
client_list = list(misc.all_roles_of_type(self._ctx.cluster, 'client'))
self.client_id = client_list[0]
@ -632,6 +633,11 @@ class Filesystem(MDSCluster):
else:
raise
if self.fs_config is not None:
max_mds = self.fs_config.get('max_mds', 1)
if max_mds > 1:
self.set_max_mds(max_mds)
self.getinfo(refresh = True)
def destroy(self, reset_obj_attrs=True):