Merge pull request #754 from wanyaoqi/bugfix/wyq/fix-get-stoarge-by-access-path

bugfix :fix get storage by access path
This commit is contained in:
yunion-ci-robot
2019-05-08 18:22:32 +08:00
committed by GitHub
+1 -1
View File
@@ -623,7 +623,7 @@ func (self *SHost) GetStorageByFilePath(path string) *SStorage {
return nil
}
for i := 0; i < len(hoststorages); i += 1 {
if strings.HasPrefix(path, hoststorages[i].MountPoint) {
if len(hoststorages[i].MountPoint) > 0 && strings.HasPrefix(path, hoststorages[i].MountPoint) {
return hoststorages[i].GetStorage()
}
}