Mike Kolesnik has posted comments on this change.
Change subject: Handle missing/invalid mac address on import Vm/Template
......................................................................
Patch Set 1: (7 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
Line 788: String macRegex = "^(\\p{XDigit}{2}:){5}\\p{XDigit}{2}$";
VmNetworkInterface already has a constant VALID_MAC_ADDRESS_FORMAT which you
can use.
Line 798: if (!Regex.IsMatch(iface.getMacAddress(), macRegex)) {
Why only log & still allow the mac address to be filled?
Shouldn't we fill a new address, in case it is invalid?
Line 927:
Why add this newline?
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateCommand.java
Line 345: String macRegex = "^(\\p{XDigit}{2}:){5}\\p{XDigit}{2}$";
Same comment about the constant already existing.
Line 372: if (StringHelper.isNullOrEmpty(iface.getMacAddress())) {
Why is this code copy-pasted?
Since the 2 classes inherit from the same base class, it can be put there in a
method.
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
Line 579: IMPORTEXPORT_IMPORT_INTERFACES_WITH_INVALID_MAC_ADDRESS(9602,
AuditLogTimeInterval.MINUTE.getValue()),
Why did you specify interval?
This is not an auto-generated message, it's only triggered by an import event,
and should be displayed (if needed) on each import event.
....................................................
File
backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
Line 500: IMPORTEXPORT_IMPORT_INTERFACES_WITH_INVALID_MAC_ADDRESS=Vm ${VmName}
have interface ${IfaceName} with invalid mac address ${MacAddress}
I think this should be: "Vm ${VmName} has an interface ${IfaceName} with an
invalid MAC address ${MacAddress)."
--
To view, visit http://gerrit.ovirt.org/5290
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I09dd86a352ecc17e80dceb8c331ec38f4fa96627
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <[email protected]>
Gerrit-Reviewer: Mike Kolesnik <[email protected]>
Gerrit-Reviewer: Shahar Havivi <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches