Merge pull request #491 from swordqiu/hotfix/qj-server-update-validate-skip-quota-check-if-cpu-mem-not-set

fix: skip quota check in server validateupdatedata if cpu and mem not updated
This commit is contained in:
yunion-ci-robot
2019-04-19 16:52:12 +08:00
committed by GitHub
+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") {