mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
fix: make test format errors (#13898)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
@@ -376,7 +376,7 @@ func init() {
|
||||
url := fmt.Sprintf("%s/download/disks/%s/%s", managerUri, storageId, args.ID)
|
||||
resp, err := httputils.Request(client, context.Background(), httputils.GET, url, header, nil, args.Debug)
|
||||
if err != nil {
|
||||
log.Errorf("request %s error: %v", err)
|
||||
log.Errorf("request %s error: %v", url, err)
|
||||
continue
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
@@ -1652,7 +1652,7 @@ func (s *SKVMGuestInstance) SyncMetadata(meta *jsonutils.JSONDict) error {
|
||||
_, err := modules.Servers.SetMetadata(hostutils.GetComputeSession(context.Background()),
|
||||
s.Id, meta)
|
||||
if err != nil {
|
||||
log.Errorln("sync metadata error: %v", err)
|
||||
log.Errorf("sync metadata error: %v", err)
|
||||
return errors.Wrap(err, "set metadata")
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -429,8 +429,8 @@ func (s *SBaseStorage) CreateDiskFromBackup(ctx context.Context, disk IDisk, inp
|
||||
backupPath := path.Join(s.GetBackupDir(), info.Backup.BackupId)
|
||||
img, err := qemuimg.NewQemuImage(backupPath)
|
||||
if err != nil {
|
||||
log.Errorln("unable to new qemu image for %s: %s", backupPath, err.Error())
|
||||
return err
|
||||
log.Errorf("unable to new qemu image for %s: %s", backupPath, err.Error())
|
||||
return errors.Wrapf(err, "unable to new qemu image for %s", backupPath)
|
||||
}
|
||||
_, err = img.Clone(disk.GetPath(), qemuimg.QCOW2, false)
|
||||
return err
|
||||
|
||||
@@ -125,8 +125,8 @@ func (s *SLocalStorage) CreateDiskFromBackup(ctx context.Context, disk IDisk, in
|
||||
}
|
||||
img, err := qemuimg.NewQemuImage(backupPath)
|
||||
if err != nil {
|
||||
log.Errorln("unable to new qemu image for %s: %s", backupPath, err.Error())
|
||||
return err
|
||||
log.Errorf("unable to new qemu image for %s: %s", backupPath, err.Error())
|
||||
return errors.Wrapf(err, "unable to new qemu image for %s", backupPath)
|
||||
}
|
||||
_, err = img.Clone(disk.GetPath(), qemuimg.QCOW2, false)
|
||||
return err
|
||||
|
||||
@@ -565,7 +565,7 @@ func (self *SImage) SaveImageFromStream(reader io.Reader, totalSize int64, calCh
|
||||
if err != nil {
|
||||
if fileutils2.IsFile(localPath) {
|
||||
if e := os.Remove(localPath); e != nil {
|
||||
log.Errorf("remove failed file %s error: %v", err)
|
||||
log.Errorf("remove failed file %s error: %v", localPath, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ func (self *SZone) GetIStorages() ([]cloudprovider.ICloudStorage, error) {
|
||||
func (self *SZone) GetIStorageById(id string) (cloudprovider.ICloudStorage, error) {
|
||||
storage, err := self.region.GetStorage(id)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "GetStorage", id)
|
||||
return nil, errors.Wrapf(err, "GetStorage %s", id)
|
||||
}
|
||||
if storage.ClusterUUID != self.UUID {
|
||||
return nil, errors.Wrapf(cloudprovider.ErrNotFound, id)
|
||||
|
||||
Reference in New Issue
Block a user