From 334cdaf28616631ecb9ca1c94a070fcbb7dee729 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Wed, 15 Nov 2023 20:51:47 +0530 Subject: [PATCH 1/2] qa: correct usage of DEBUGFS_META_DIR in dedent Signed-off-by: Venky Shankar --- qa/tasks/cephfs/kernel_mount.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qa/tasks/cephfs/kernel_mount.py b/qa/tasks/cephfs/kernel_mount.py index 750b6b5335a..f005152af98 100644 --- a/qa/tasks/cephfs/kernel_mount.py +++ b/qa/tasks/cephfs/kernel_mount.py @@ -257,9 +257,10 @@ class KernelMount(CephFSMount): import json def get_id_to_dir(): - result = {} + meta_dir = "{meta_dir}" + result = dict() for dir in glob.glob("/sys/kernel/debug/ceph/*"): - if os.path.basename(dir) == DEBUGFS_META_DIR: + if os.path.basename(dir) == meta_dir: continue mds_sessions_lines = open(os.path.join(dir, "mds_sessions")).readlines() global_id = mds_sessions_lines[0].split()[1].strip('"') @@ -267,7 +268,7 @@ class KernelMount(CephFSMount): result[client_id] = global_id return result print(json.dumps(get_id_to_dir())) - """) + """.format(meta_dir=DEBUGFS_META_DIR)) output = self.client_remote.sh([ 'sudo', 'python3', '-c', pyscript From 8df2c4642518de18ca2867283d744441b39e283e Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Wed, 15 Nov 2023 20:57:02 +0530 Subject: [PATCH 2/2] qa: get_global_id() returns a string (global_id) Signed-off-by: Venky Shankar --- qa/tasks/cephfs/kernel_mount.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/tasks/cephfs/kernel_mount.py b/qa/tasks/cephfs/kernel_mount.py index f005152af98..0cd3501637b 100644 --- a/qa/tasks/cephfs/kernel_mount.py +++ b/qa/tasks/cephfs/kernel_mount.py @@ -340,7 +340,7 @@ echo '{fdata}' | sudo tee /sys/kernel/debug/dynamic_debug/control if self.inst is not None: return self.inst - client_gid = "client%d" % self.get_global_id() + client_gid = "client%d" % int(self.get_global_id()) self.inst = " ".join([client_gid, self._global_addr]) return self.inst