Hello Lior Vernia, I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/31246 to review the following change. Change subject: core: Enable single-entry MAC range in engine-config ...................................................................... core: Enable single-entry MAC range in engine-config This was previously wrongly blocked. It also seems like the utility class blocking this had another logical issue - in cases where multiple ranges need to be handled (I don't see that this can happen at the moment but the code seems to take that into consideration), true would be returned if at least one of the ranges were valid - instead of false being returned if at least one of the ranges were invalid. Change-Id: Ic0241cfb38c74cb7fe5ab945b16642bb93c50eef Bug-Url: https://bugzilla.redhat.com/1126181 Signed-off-by: Lior Vernia <lver...@redhat.com> Signed-off-by: Martin Mucha <mmu...@redhat.com> --- M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/MacAddressRangeUtils.java M backend/manager/tools/src/test/java/org/ovirt/engine/core/config/entity/helper/MacAddressPoolRangesValueHelperTest.java 2 files changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/46/31246/1 diff --git a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/MacAddressRangeUtils.java b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/MacAddressRangeUtils.java index d547cc6..e43863d 100644 --- a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/MacAddressRangeUtils.java +++ b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/MacAddressRangeUtils.java @@ -133,11 +133,11 @@ Collection<LongRange> ranges = parseRangeString(start + "-" + end); for (LongRange range : ranges) { - if (range.getMaximumLong() - range.getMinimumLong() > 0) { - return true; + if (range.getMaximumLong() - range.getMinimumLong() < 0) { + return false; } } - return false; + return true; } } diff --git a/backend/manager/tools/src/test/java/org/ovirt/engine/core/config/entity/helper/MacAddressPoolRangesValueHelperTest.java b/backend/manager/tools/src/test/java/org/ovirt/engine/core/config/entity/helper/MacAddressPoolRangesValueHelperTest.java index dacd590..415b4cd 100644 --- a/backend/manager/tools/src/test/java/org/ovirt/engine/core/config/entity/helper/MacAddressPoolRangesValueHelperTest.java +++ b/backend/manager/tools/src/test/java/org/ovirt/engine/core/config/entity/helper/MacAddressPoolRangesValueHelperTest.java @@ -31,6 +31,7 @@ public static Collection<Object[]> ipAddressParams() { return Arrays.asList(new Object[][] { { "00:00:00:00:00:00-00:00:00:00:00:FF", true }, + { "00:1A:4A:16:88:FD-00:1A:4A:16:88:FD", true }, { "AA:AA:AA:AA:AA:AA-AA:AA:AA:AA:AA:AB", true }, { "AA:AA:AA:AA:AA:AA-aa:aa:aa:aa:aa:ab", true }, { "aa:aa:aa:aa:aa:aa-AA:AA:AA:AA:AA:AB", true }, -- To view, visit http://gerrit.ovirt.org/31246 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic0241cfb38c74cb7fe5ab945b16642bb93c50eef Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Mucha <mmu...@redhat.com> Gerrit-Reviewer: Lior Vernia <lver...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches