Created attachment 601491 [details] log Description of problem: if I select multiple quota's I can remove all quota objects from the system when I remove one by one we get a CanDoAction on the last one. 2012-07-31 12:42:53,371 WARN [org.ovirt.engine.core.bll.RemoveQuotaCommand] (http-/0.0.0.0:8080-1) CanDoAction of action RemoveQuota failed. Reasons:VAR__ACTION__REMOVE,VAR__TYPE__QUOTA,ACTION_TYPE_FAILED_DATA_CENTER_MUST_HAVE_AT_LEAST_ONE_QUOTA Version-Release number of selected component (if applicable): si12 How reproducible: 100% Steps to Reproduce: 1. create several quota's 2. remove one by one 3. Actual results: we get a CanDoAction from backend Expected results: we should be able to remove last quota in multiple and single action Additional info:log
It looks like a reminder of past default Quota. So we'll allow removing ther last Quota object. Note that this means there's no Qota defined and no VM can start, but the only way to remove this Quota is if it's not being used, which means the user already detached it. Please remove the relevant CanDoAction check.
The CanDoAction logic is faulty. It should be: If the quota is in use by a vm or image - return false (if the quota id is in ether 'vm_static' or 'images' tables).
Pushed to upstream gerrit (http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=commit;h=c85615512293465be138b4361a6af5b5c330d178)
Merged downstream: https://gerrit.eng.lab.tlv.redhat.com/gitweb?p=ovirt-engine.git;a=commit;h=2e95a27317591f434a8bb98d35f8b07442fe3566
verified on si14