Skip to content

Commit

Permalink
common/rc: Uniform the style of skip reasons
Browse files Browse the repository at this point in the history
Before:
srp/***                                                      [not run]
    driver scsi_dh_alua is not available
    driver scsi_dh_emc is not available
    driver scsi_dh_rdac is not available
    dm_multipath module is not available
    dm_queue_length module is not available
    dm_service_time module is not available
    ib_srpt module is not available
    ib_umad module is not available
    null_blk module is not available
    scsi_debug module is not available
    target_core_iblock module is not available
    sg_reset is not available

After:
srp/***                                                      [not run]
    driver scsi_dh_alua is not available
    driver scsi_dh_emc is not available
    driver scsi_dh_rdac is not available
    module dm_multipath is not available
    module dm_queue_length is not available
    module dm_service_time is not available
    module ib_srpt is not available
    module ib_umad is not available
    module null_blk is not available
    module scsi_debug is not available
    module target_core_iblock is not available
    command sg_reset is not available

Signed-off-by: Li Zhijian <[email protected]>
Reviewed-by: Chaitanya Kulkarni <[email protected]>
Signed-off-by: Shin'ichiro Kawasaki <[email protected]>
  • Loading branch information
zhijianli88 authored and kawasaki committed Nov 1, 2024
1 parent c89a7d9 commit 3e95ee0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions common/rc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ _have_driver()
# built-in the kernel.
_have_module() {
if ! _module_file_exists "${1}"; then
SKIP_REASONS+=("${1} module is not available")
SKIP_REASONS+=("module ${1} is not available")
return 1
fi
return 0
Expand All @@ -84,7 +84,7 @@ _have_module_param() {
fi

if ! modinfo -F parm -0 "$1" | grep -q -z "^$2:"; then
SKIP_REASONS+=("$1 module does not have parameter $2")
SKIP_REASONS+=("module $1 does not have parameter $2")
return 1
fi
return 0
Expand All @@ -106,7 +106,7 @@ _have_module_param_value() {

value=$(cat "/sys/module/$modname/parameters/$param")
if [[ "${value}" != "$expected_value" ]]; then
SKIP_REASONS+=("$modname module parameter $param must be set to $expected_value")
SKIP_REASONS+=("module $modname parameter $param must be set to $expected_value")
return 1
fi

Expand All @@ -117,7 +117,7 @@ _have_program() {
if command -v "$1" >/dev/null 2>&1; then
return 0
fi
SKIP_REASONS+=("$1 is not available")
SKIP_REASONS+=("command $1 is not available")
return 1
}

Expand Down

0 comments on commit 3e95ee0

Please sign in to comment.