Skip to content

Commit

Permalink
fix: sync s3 bucket status
Browse files Browse the repository at this point in the history
  • Loading branch information
Qu Xuan committed Jun 1, 2020
1 parent 9307660 commit 7cb40ec
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/compute/regiondrivers/kvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
"yunion.io/x/pkg/utils"

api "yunion.io/x/onecloud/pkg/apis/compute"
Expand Down Expand Up @@ -1120,3 +1121,15 @@ func (self *SKVMRegionDriver) RequestElasticcacheBackupRestoreInstance(ctx conte
func (self *SKVMRegionDriver) AllowUpdateElasticcacheAuthMode(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, elasticcache *models.SElasticcache) error {
return fmt.Errorf("not support update kvm elastic cache auth_mode")
}

func (self *SKVMRegionDriver) RequestSyncBucketStatus(ctx context.Context, userCred mcclient.TokenCredential, bucket *models.SBucket, task taskman.ITask) error {
taskman.LocalTaskRun(task, func() (jsonutils.JSONObject, error) {
iBucket, err := bucket.GetIBucket()
if err != nil {
return nil, errors.Wrap(err, "bucket.GetIBucket")
}

return nil, bucket.SetStatus(userCred, iBucket.GetStatus(), "syncstatus")
})
return nil
}

0 comments on commit 7cb40ec

Please sign in to comment.