fix(host): avoid delete removed disk failed

This commit is contained in:
Qu Xuan
2021-05-25 21:01:46 +08:00
parent 8f41c4165a
commit 913757f138
+4 -2
View File
@@ -29,6 +29,7 @@ import (
api "yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/appctx"
"yunion.io/x/onecloud/pkg/cloudprovider"
"yunion.io/x/onecloud/pkg/hostman/hostutils"
"yunion.io/x/onecloud/pkg/hostman/options"
"yunion.io/x/onecloud/pkg/hostman/storageman/remotefile"
@@ -85,11 +86,12 @@ func (d *SLocalDisk) Probe() error {
if fileutils2.Exists(d.getPath()) {
d.isAlter = false
return nil
} else if fileutils2.Exists(d.getAlterPath()) {
}
if fileutils2.Exists(d.getAlterPath()) {
d.isAlter = true
return nil
}
return fmt.Errorf("Disk not found")
return errors.Wrapf(cloudprovider.ErrNotFound, "%s", d.getPath())
}
func (d *SLocalDisk) UmountFuseImage() {