Change in ovirt-engine[ovirt-engine-3.6.2]: core: fix badly generated macs in db
tnisan at redhat.com
tnisan at redhat.com
Mon Jan 4 13:58:40 UTC 2016
Tal Nisan 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 at redhat.com>
---
A packaging/dbscripts/upgrade/03_06_1980_fix_invalid_macs.sql
1 file changed, 28 insertions(+), 0 deletions(-)
Approvals:
Martin Mucha: Verified
Alona Kaplan: Looks good to me, approved
Jenkins CI: Passed CI tests
--
To view, visit https://gerrit.ovirt.org/51289
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I962d96dbde5afaf19c94763ac51166c958a2f0bd
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.6.2
Gerrit-Owner: Martin Mucha <mmucha at redhat.com>
Gerrit-Reviewer: Alona Kaplan <alkaplan at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Mucha <mmucha at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
More information about the Engine-commits
mailing list