Skip to content

Commit 5137ef9

Browse files
committed
common/nvme: fix nvme json support check in _have_nvme_cli_with_json_support
$ nvme list Failed to scan topology: No such file or directory $ nvme list -o json { "error":"Failed to scan topology: No such file or directory" } $ ./check nvme/006 nvme/*** [not run] nvme-cli does not support json output format $ modprobe nvme-loop $ ./check nvme/006 nvme/006 (tr=loop bd=device) (create an NVMeOF target) [passed] runtime ... 0.141s nvme/006 (tr=loop bd=file) (create an NVMeOF target) [passed] runtime ... 0.117s Link: #177 Suggested-by: Daniel Wagner <[email protected]> Signed-off-by: Yi Zhang <[email protected]>
1 parent b120d18 commit 5137ef9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

common/nvme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ _require_nvme_trtype_is_fabrics() {
6565
_have_nvme_cli_with_json_support() {
6666
_have_program nvme || return $?
6767

68-
if ! nvme list --output-format=json &> /dev/null; then
68+
if ! nvme list --help 2>&1 | grep -q json; then
6969
SKIP_REASONS+=("nvme-cli does not support json output format")
7070
return 1
7171
fi

0 commit comments

Comments
 (0)