fix(host): avoid storage attach not report error

This commit is contained in:
Qu Xuan
2021-10-28 16:59:35 +08:00
parent fd6e603e44
commit 28a5da3e6b

View File

@@ -21,6 +21,7 @@ import (
"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
"yunion.io/x/onecloud/pkg/appsrv"
"yunion.io/x/onecloud/pkg/hostman/hostutils"
@@ -116,6 +117,10 @@ func storageAttach(ctx context.Context, body jsonutils.JSONObject) (interface{},
if err := storage.SetStorageInfo(storageId, storageName, storageConf); err != nil {
return nil, err
}
err = storage.SyncStorageSize()
if err != nil {
return nil, errors.Wrapf(err, "SyncStorageSize")
}
resp, err := storage.SyncStorageInfo()
if err != nil {
return nil, err