From 529e70fd94ab544249c32ef6d699c1c785f7e368 Mon Sep 17 00:00:00 2001 From: Naresh Bannoth Date: Mon, 30 Dec 2024 15:30:23 +0530 Subject: [PATCH] Fixing controller and namespace accessing issue in nvme.py In few places the nvme controller and namespaces access are slightly different. So made them correct to get the right output. Signed-off-by: Naresh Bannoth --- avocado/utils/nvme.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/avocado/utils/nvme.py b/avocado/utils/nvme.py index f9dc3902ec..c62f4126a6 100644 --- a/avocado/utils/nvme.py +++ b/avocado/utils/nvme.py @@ -137,9 +137,9 @@ def get_block_size(controller_name): namespaces = get_current_ns_list(controller_name) if namespaces: namespace = namespaces[0] - cmd = f"nvme id-ns /dev/{namespace}" + cmd = f"nvme id-ns {namespace}" out = process.run(cmd, shell=True, ignore_status=True).stdout_text - for line in str(out.splitlines): + for line in out.splitlines(): if "in use" in line: return pow(2, int(line.split()[4].split(":")[-1])) return 4096 @@ -211,7 +211,7 @@ def ns_rescan(controller_name): :param controller_name: controller name on which re-scan is applied """ - cmd = f"nvme ns-rescan {controller_name}" + cmd = f"nvme ns-rescan /dev/{controller_name}" try: process.run(cmd, shell=True, ignore_status=True) except process.CmdError as detail: