Skip to content

Commit

Permalink
Merge pull request #6499 from swordqiu/hotfix/qj-init-cloud-account-s…
Browse files Browse the repository at this point in the history
…hare-mode

fix: cloudaccount share_mode not initialized
  • Loading branch information
zexi committed May 21, 2020
2 parents 9b37c10 + 08eda0d commit daf9db8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/compute/models/cloudaccounts.go
Expand Up @@ -479,6 +479,13 @@ func (self *SCloudaccount) CustomizeCreate(ctx context.Context, userCred mcclien
// mark the public_scope has been set
data.(*jsonutils.JSONDict).Set("public_scope", jsonutils.NewString(self.PublicScope))
}
if len(self.ShareMode) == 0 {
if self.IsPublic {
self.ShareMode = api.CLOUD_ACCOUNT_SHARE_MODE_SYSTEM
} else {
self.ShareMode = api.CLOUD_ACCOUNT_SHARE_MODE_ACCOUNT_DOMAIN
}
}
return self.SEnabledStatusInfrasResourceBase.CustomizeCreate(ctx, userCred, ownerId, query, data)
}

Expand Down

0 comments on commit daf9db8

Please sign in to comment.