FormatAndMount unit test only checks for MountErrorValue now and closed gaps for some error values

This commit is contained in:
David Zhu
2020-01-23 19:25:03 -08:00
committed by Srini Brahmaroutu
parent 99f567aa7a
commit 5d34e5006a
3 changed files with 28 additions and 28 deletions

View File

@@ -315,12 +315,12 @@ func (mounter *SafeFormatAndMount) formatAndMount(source string, target string,
}
options = append(options, "defaults")
var mountErrorValue MountErrorType
mountErrorValue := UnknownMountError
// Check if the disk is already formatted
existingFormat, err := mounter.GetDiskFormat(source)
if err != nil {
return err
return NewMountError(GetDiskFormatFailed, "failed to get disk format of disk %s: %v", source, err)
}
// Use 'ext4' as the default