Alona Kaplan has submitted this change and it was merged.
Change subject: core: fix badly generated macs in db
......................................................................
core: fix badly generated macs in db
Note: this patch replaces former one
(I4a1b37da30ce4ad6d25c1d510eb5c09e17525f1b)
because different approach to fix this issue was requested.
There was .py script¹ (now deleted) which was used to generate mac
ranges in some circumstances. However there was a bug in it, so some
users may end up with MAC address like 00:1a:4a:1:f:ff generated
(fourth and fifth group can be formed just by one char).
This MAC got without any validation into DB and engine did not detect
this problem — since engine code just removes colons and parse value
as hex. So in that case user ended up with different mac ranges than
intended. In 3.6 code validations were added to UI, where such MAC
will fail when user just opens DC edit dialog and confirm it without
any change.
Because code did not fail, user could continue using such setting,
but actually different range was used. For example if generated
range was 00:1a:4a:1:f:00-00:1a:4a:1:f:ff, engine actually
used range was: 00:00:1a:4a:1f:00-00:00:1a:4a:1f:ff.
This patch tries to fix db entries in same way.
description of sql udpate:
Patch is little bit convoluted because it tries not to use stored
procedures. Flow is:
• first colons are removed
• missing zeroes are added to the left of string to reach total of
12 chars
• after each two chars new colon is added; this creates string
enging with colon
• extra last character is removed.
[1] ./packaging/setup/plugins/ovirt-engine-setup/config/macrange.py
Change-Id: I962d96dbde5afaf19c94763ac51166c958a2f0bd
Bug-Url:
https://bugzilla.redhat.com/1286132
Signed-off-by: Martin Mucha <mmucha(a)redhat.com>
---
M packaging/dbscripts/upgrade/04_00_0120_fix_invalid_macs.sql
1 file changed, 23 insertions(+), 15 deletions(-)
Approvals:
Martin Mucha: Verified
Alona Kaplan: Looks good to me, approved; Passed CI tests
--
To view, visit
https://gerrit.ovirt.org/51037
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I962d96dbde5afaf19c94763ac51166c958a2f0bd
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Mucha <mmucha(a)redhat.com>
Gerrit-Reviewer: Alona Kaplan <alkaplan(a)redhat.com>
Gerrit-Reviewer: Eli Mesika <emesika(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Mucha <mmucha(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>