Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing controller and namespace accessing issue in nvme.py #6085

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions avocado/utils/nvme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
Loading