fix: guest create eip quota check use owner quota

This commit is contained in:
Qiu Jian
2019-10-09 17:27:44 +08:00
parent 895956b420
commit ce9d7978ca
+2 -1
View File
@@ -2531,7 +2531,8 @@ func (self *SGuest) PerformCreateEip(ctx context.Context, userCred mcclient.Toke
quotaPlatform := self.GetQuotaPlatformID()
eipPendingUsage := &SQuota{Eip: 1}
err = QuotaManager.CheckSetPendingQuota(ctx, userCred, rbacutils.ScopeProject, userCred, quotaPlatform, eipPendingUsage)
ownerCred := self.GetOwnerId()
err = QuotaManager.CheckSetPendingQuota(ctx, userCred, rbacutils.ScopeProject, ownerCred, quotaPlatform, eipPendingUsage)
if err != nil {
return nil, httperrors.NewOutOfQuotaError("Out of eip quota: %s", err)
}