fix: skip quota check in server validateupdatedata if cpu and mem not

updated
This commit is contained in:
Qiu Jian
2019-04-19 12:32:28 +08:00
parent 5fa4ce519a
commit a04be21c61
+5 -3
View File
@@ -798,9 +798,11 @@ func (self *SGuest) ValidateUpdateData(ctx context.Context, userCred mcclient.To
return nil, err
}
err = self.checkUpdateQuota(ctx, userCred, vcpuCount, vmemSize)
if err != nil {
return nil, httperrors.NewOutOfQuotaError(err.Error())
if vcpuCount > 0 || vmemSize > 0 {
err = self.checkUpdateQuota(ctx, userCred, vcpuCount, vmemSize)
if err != nil {
return nil, httperrors.NewOutOfQuotaError(err.Error())
}
}
if data.Contains("name") {