ofri masad has uploaded a new change for review.

Change subject: core: Enable remove quota when quota is not enforced
......................................................................

core: Enable remove quota when quota is not enforced

In current implementation there is no way to remove all quota from the
DC once a quota was assigned to some entities.

The CanDoAction logic of removing quota was changed so that when a DC is
in 'Disabled' Quota enforcement mode a quota could be removed
(regardless of it been assigned to some entities).

Change-Id: I95ff993b0db21a17e62e3258338bd524c5c8b957
Bug-Url: https://bugzilla.redhat.com/895237
Signed-off-by: Ofri Masad <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveQuotaCommand.java
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/05/11505/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveQuotaCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveQuotaCommand.java
index cfca006..1e0bc27 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveQuotaCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveQuotaCommand.java
@@ -9,6 +9,7 @@
 import org.ovirt.engine.core.common.VdcObjectType;
 import org.ovirt.engine.core.common.action.QuotaCRUDParameters;
 import org.ovirt.engine.core.common.businessentities.Quota;
+import org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum;
 import org.ovirt.engine.core.dal.VdcBllMessages;
 
 public class RemoveQuotaCommand extends QuotaCRUDCommand {
@@ -37,7 +38,7 @@
         }
 
         // If the quota is in use by ether VM or image - return false
-        if (getQuotaDAO().isQuotaInUse(quota)) {
+        if (getQuotaDAO().isQuotaInUse(quota) && 
!quota.getQuotaEnforcementType().equals(QuotaEnforcementTypeEnum.DISABLED)) {
             
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IN_USE_BY_VM_OR_DISK);
             return false;
         }


--
To view, visit http://gerrit.ovirt.org/11505
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I95ff993b0db21a17e62e3258338bd524c5c8b957
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: ofri masad <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to