From 0280dac6b1ad735690144717cf81568392e8a526 Mon Sep 17 00:00:00 2001 From: Huamin Chen Date: Wed, 17 Jun 2015 14:36:56 -0400 Subject: [PATCH] check IsNotExist error when validating mountpoint Signed-off-by: Huamin Chen --- pkg/volume/rbd/rbd_util.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/volume/rbd/rbd_util.go b/pkg/volume/rbd/rbd_util.go index c4a81085f0b..a031ac325b4 100644 --- a/pkg/volume/rbd/rbd_util.go +++ b/pkg/volume/rbd/rbd_util.go @@ -101,7 +101,8 @@ func (util *RBDUtil) AttachDisk(rbd rbd) error { // mount it globalPDPath := rbd.manager.MakeGlobalPDName(rbd) mountpoint, err := rbd.mounter.IsMountPoint(globalPDPath) - if err != nil { + // in the first time, the path shouldn't exist and IsMountPoint is expected to get NotExist + if err != nil && !os.IsNotExist(err) { return fmt.Errorf("rbd: %s failed to check mountpoint", globalPDPath) } if mountpoint {