Commit 0280dac6 authored by Huamin Chen's avatar Huamin Chen

check IsNotExist error when validating mountpoint

Signed-off-by: 's avatarHuamin Chen <hchen@redhat.com>
parent b65c321a
...@@ -101,7 +101,8 @@ func (util *RBDUtil) AttachDisk(rbd rbd) error { ...@@ -101,7 +101,8 @@ func (util *RBDUtil) AttachDisk(rbd rbd) error {
// mount it // mount it
globalPDPath := rbd.manager.MakeGlobalPDName(rbd) globalPDPath := rbd.manager.MakeGlobalPDName(rbd)
mountpoint, err := rbd.mounter.IsMountPoint(globalPDPath) 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) return fmt.Errorf("rbd: %s failed to check mountpoint", globalPDPath)
} }
if mountpoint { if mountpoint {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment