fix: make test format errors (#13898)

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
Jian Qiu
2022-04-05 11:13:40 +08:00
committed by GitHub
co-authored by Qiu Jian
parent eeb076c45d
commit 2215f3d760
6 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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)
}
}
}
+1 -1
View File
@@ -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)