From 377d52cb9867dc4074fe78965e1bfcdf80be14a1 Mon Sep 17 00:00:00 2001 From: Laszlo Gombos Date: Wed, 10 Jul 2024 08:43:31 -0400 Subject: [PATCH] fix(multipath): omit module if included with no multipath devices Follow-up to 4957ffa935. return 255 instead of 1 and change the order of checks. --- modules.d/90multipath/module-setup.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh index 4b4e8150b..0a1fd5580 100755 --- a/modules.d/90multipath/module-setup.sh +++ b/modules.d/90multipath/module-setup.sh @@ -23,6 +23,10 @@ majmin_to_mpath_dev() { check() { local _any_mpath_dev + # if there's no multipath binary, no go. + require_binaries multipath || return 1 + require_binaries kpartx || return 1 + for_each_host_dev_and_slaves is_mpath _any_mpath_dev=$? @@ -30,12 +34,8 @@ check() { [[ $_any_mpath_dev == 0 ]] || return 255 } - # if there's no multipath binary, no go. - require_binaries multipath || return 1 - require_binaries kpartx || return 1 - if [[ $_any_mpath_dev != 0 ]] && [[ ! -f /etc/multipath.conf ]]; then - return 1 + return 255 fi return 0 -- 2.47.3