vdev_id: Return an error if config file is not found

Signed-off-by: Anton Gubarkov <anton.gubarkov@gmail.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Anton Gubarkov 2021-08-25 23:01:26 +03:00 committed by Tony Hutter
parent e78d06f89b
commit bc371b2806
1 changed files with 3 additions and 2 deletions

View File

@ -140,7 +140,8 @@ Usage: vdev_id [-h]
-p number of phy's per switch port [default=$PHYS_PER_PORT] -p number of phy's per switch port [default=$PHYS_PER_PORT]
-h show this summary -h show this summary
EOF EOF
exit 0 exit 1
# exit with error to avoid processing usage message by a udev rule
} }
map_slot() { map_slot() {
@ -728,7 +729,7 @@ done
if [ ! -r "$CONFIG" ] ; then if [ ! -r "$CONFIG" ] ; then
echo "Error: Config file \"$CONFIG\" not found" echo "Error: Config file \"$CONFIG\" not found"
exit 0 exit 1
fi fi
if [ -z "$DEV" ] && [ -z "$ENCLOSURE_MODE" ] ; then if [ -z "$DEV" ] && [ -z "$ENCLOSURE_MODE" ] ; then