Distinguish normal mount from format and mount in SafeFormatAndMount

This commit is contained in:
Sami Wagiaalla
2015-11-05 16:49:40 -05:00
parent 0798915490
commit 66c905d63e
12 changed files with 42 additions and 32 deletions

View File

@@ -273,7 +273,7 @@ func (util *RBDUtil) AttachDisk(b rbdBuilder) error {
// the json file remains invisible during rbd mount and thus won't be removed accidentally.
util.persistRBD(b, globalPDPath)
if err = b.mounter.Mount(devicePath, globalPDPath, b.fsType, nil); err != nil {
if err = b.mounter.FormatAndMount(devicePath, globalPDPath, b.fsType, nil); err != nil {
err = fmt.Errorf("rbd: failed to mount rbd volume %s [%s] to %s, error %v", devicePath, b.fsType, globalPDPath, err)
}
return err