Skip to content

Commit

Permalink
Fixing the command output not iterable error in nvme.py
Browse files Browse the repository at this point in the history
we see the command output was not splittable and non iterable error.
so fixed here for same.

Signed-off-by: Naresh Bannoth <[email protected]>
  • Loading branch information
Naresh-ibm committed Sep 8, 2024
1 parent a2e1ca5 commit c5e7788
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions avocado/utils/nvme.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ def get_block_size(controller_name):
if namespaces:
namespace = namespaces[0]
cmd = f"nvme id-ns /dev/{namespace}"
out = process.run(cmd, shell=True, ignore_status=True)
for line in out.splitlines:
out = process.run(cmd, shell=True, ignore_status=True).stdout_text
for line in str(out.splitlines):
if "in use" in line:
return pow(2, int(line.split()[4].split(":")[-1]))
return 4096
Expand Down

0 comments on commit c5e7788

Please sign in to comment.