Maor Lipchuk has uploaded a new change for review. Change subject: core:Switch between percentage and space validation. ......................................................................
core:Switch between percentage and space validation. The validation today validates storage free space in a method called check percentage free space and vise versa, this method names should be switched. Also use the calculation introduced in the previous patch in StorageDomainDynamic for this validation. Change-Id: I4612035dc5e93c7dea872b23d274724154530395 Related-to: https://bugzilla.redhat.com/856201 Signed-off-by: Maor Lipchuk <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/command/utils/StorageDomainSpaceChecker.java 1 file changed, 3 insertions(+), 7 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/05/11405/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/command/utils/StorageDomainSpaceChecker.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/command/utils/StorageDomainSpaceChecker.java index d7d2d08..91c8a23 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/command/utils/StorageDomainSpaceChecker.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/command/utils/StorageDomainSpaceChecker.java @@ -11,15 +11,11 @@ return isBelowSpaceThreshold(domain) && isBelowPctThreshold(domain); } - private static boolean isBelowSpaceThreshold(final storage_domains domain) { - Integer availableDiskSize = domain.getavailable_disk_size() == null ? 0 : domain.getavailable_disk_size(); - Integer usedDiskSize = domain.getused_disk_size() == null ? 0 : domain.getused_disk_size(); - double totalSize = availableDiskSize + usedDiskSize; - return totalSize != 0 - && (availableDiskSize / totalSize) * (double) 100 > getLowDiskPercentThreshold(); + private static boolean isBelowPctThreshold(final storage_domains domain) { + return domain.getStorageDynamicData().getfreeDiskPercent() > getLowDiskPercentThreshold(); } - private static boolean isBelowPctThreshold(final storage_domains domain) { + private static boolean isBelowSpaceThreshold(final storage_domains domain) { StorageDomainDynamic dynamic = domain.getStorageDynamicData(); return (dynamic != null && dynamic.getfreeDiskInGB() > Config -- To view, visit http://gerrit.ovirt.org/11405 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4612035dc5e93c7dea872b23d274724154530395 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Maor Lipchuk <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
