]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
init-rbdmap: minor fix no rbd exist 497/head
authorLaurent Barbe <laurent@ksperis.com>
Tue, 13 Aug 2013 15:45:03 +0000 (17:45 +0200)
committerLaurent Barbe <laurent@ksperis.com>
Tue, 13 Aug 2013 16:07:46 +0000 (18:07 +0200)
Avoid error if stop when no rbd device exist

Signed-off-by: Laurent Barbe <laurent@ksperis.com>
src/init-rbdmap

index 16d618a6c0d5b432bd405b76674d806351fcf7ab..54554ae40d74f12138a48463795e6b093cdc9607 100755 (executable)
@@ -68,11 +68,13 @@ do_unmap() {
                umount $MNT
        done 
        # Unmap all rbd device
-       for DEV in /dev/rbd[0-9]*; do
-               log_progress_msg $DEV
-               rbd unmap $DEV
-               [ $? -ne "0" ] && RET=1
-       done
+       if [ -b /dev/rbd[0-9]* ]; then
+               for DEV in /dev/rbd[0-9]*; do
+                       log_progress_msg $DEV
+                       rbd unmap $DEV
+                       [ $? -ne "0" ] && RET=1
+               done
+       fi
        log_end_msg $RET
 }