Merge pull request #11906 from ioito/automated-cherry-pick-of-#11905-release-3.7

Automated cherry pick of #11905: fix(cloudevent): hcso event fix
This commit is contained in:
Zexi Li
2021-08-15 00:14:25 +08:00
committed by GitHub

View File

@@ -303,8 +303,9 @@ func (self *SCloudprovider) GetNextTimeRange() (time.Time, time.Time, error) {
}
type SCloudproviderDelegate struct {
Id string
Name string
Id string
Name string
CloudaccountId string
Enabled bool
Status string
@@ -336,6 +337,16 @@ func (self *SCloudprovider) GetDelegate() (*SCloudproviderDelegate, error) {
if err != nil {
return nil, errors.Wrap(err, "result.Unmarshal")
}
if provider.Provider == api.CLOUD_PROVIDER_APSARA || provider.Provider == api.CLOUD_PROVIDER_HUAWEI_CLOUD_STACK {
result, err := modules.Cloudaccounts.Get(s, provider.CloudaccountId, nil)
if err != nil {
return nil, errors.Wrapf(err, "modules.Cloudaccounts.Get")
}
err = result.Unmarshal(&provider.Options, "options")
if err != nil {
return nil, errors.Wrap(err, "result.Unmarshal")
}
}
return provider, nil
}