mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: error returned by host storage sync was overwritten (#17961)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
@@ -262,8 +262,13 @@ func (s *SLocalStorage) SyncStorageInfo() (jsonutils.JSONObject, error) {
|
||||
res, err = modules.Storages.Put(
|
||||
hostutils.GetComputeSession(context.Background()),
|
||||
s.StorageId, content)
|
||||
if err != nil {
|
||||
log.Errorf("SyncStorageInfo Failed: %s: %s", content, err)
|
||||
return nil, errors.Wrapf(err, "Storages.Put %s", s.StorageId)
|
||||
}
|
||||
} else {
|
||||
mediumType, err := s.GetMediumType()
|
||||
var mediumType string
|
||||
mediumType, err = s.GetMediumType()
|
||||
if err != nil {
|
||||
log.Errorf("failed get medium type %s %s", s.GetPath(), err)
|
||||
} else {
|
||||
@@ -272,11 +277,13 @@ func (s *SLocalStorage) SyncStorageInfo() (jsonutils.JSONObject, error) {
|
||||
|
||||
res, err = modules.Storages.Create(
|
||||
hostutils.GetComputeSession(context.Background()), content)
|
||||
if err != nil {
|
||||
log.Errorf("SyncStorageInfo Failed: %s: %s", content, err)
|
||||
return nil, errors.Wrapf(err, "Storages.Create %s", content)
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
log.Errorf("SyncStorageInfo Failed: %s: %s", content, err)
|
||||
}
|
||||
return res, err
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func (s *SLocalStorage) GetDiskById(diskId string) (IDisk, error) {
|
||||
|
||||
Reference in New Issue
Block a user