Merge pull request #12543 from ioito/automated-cherry-pick-of-#12540-upstream-release-3.6

Automated cherry pick of #12540: fix(host): avoid storage attach not report error
This commit is contained in:
Zexi Li
2021-10-28 18:25:56 +08:00
committed by GitHub

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