Allon Mureinik has posted comments on this change. Change subject: core: Template's empty string as a disk alias fix ......................................................................
Patch Set 1: (5 comments) http://gerrit.ovirt.org/#/c/34256/1//COMMIT_MSG Commit Message: Line 5: CommitDate: 2014-10-20 14:44:06 +0300 Line 6: Line 7: core: Template's empty string as a disk alias fix Line 8: Line 9: While making a new Template based on a VM, providing the template's s/Temaple/template/ Line 10: allocated disks's alias as an empty string is now disabled Line 11: Line 12: Change-Id: If20fcbe3ae6507ba1f39c6e336928fb647efeb1e Line 13: Bug-Url: https://bugzilla.redhat.com/1110304 Line 6: Line 7: core: Template's empty string as a disk alias fix Line 8: Line 9: While making a new Template based on a VM, providing the template's Line 10: allocated disks's alias as an empty string is now disabled missing "." at the end of a sentence. Line 11: Line 12: Change-Id: If20fcbe3ae6507ba1f39c6e336928fb647efeb1e Line 13: Bug-Url: https://bugzilla.redhat.com/1110304 Line 7: core: Template's empty string as a disk alias fix Line 8: Line 9: While making a new Template based on a VM, providing the template's Line 10: allocated disks's alias as an empty string is now disabled Line 11: General: The commit message should explain not only WHAT a patch does (which this does quite nicely), but also WHY we're doing it. Line 12: Change-Id: If20fcbe3ae6507ba1f39c6e336928fb647efeb1e Line 13: Bug-Url: https://bugzilla.redhat.com/1110304 http://gerrit.ovirt.org/#/c/34256/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java: Line 410: } Line 411: Line 412: // Check that all the template's allocated disk's aliases are not an empty string. Line 413: Iterator<DiskImage> it = diskInfoDestinationMap.values().iterator(); Line 414: while (it.hasNext()) { IMHO, it'll be more elegant to use an enhanced for loop: for (DiskImage d : diskInfoDestinationMap.values()) { if (d.getDiskAlias().isEmpty()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_CANNOT_BE_CREATED_ WITH_EMPTY_DISK_ALIAS); } } Line 415: if (it.next().getDiskAlias().isEmpty()) { Line 416: return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_CANNOT_BE_CREATED_WITH_EMPTY_DISK_ALIAS); Line 417: } Line 418: } http://gerrit.ovirt.org/#/c/34256/1/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties File backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties: Line 250: ACTION_TYPE_FAILED_INSTANCE_TYPE_DOES_NOT_EXIST=Cannot ${action} ${type}. The relevant Instance Type doesn't exist. Line 251: ACTION_TYPE_FAILED_IMAGE_TYPE_DOES_NOT_EXIST=Cannot ${action} ${type}. The relevant Image Type doesn't exist. Line 252: ACTION_TYPE_FAILED_TEMPLATE_IS_DISABLED=Cannot ${action} ${type}. The Template is disabled, please try to enable the template first and try again. Line 253: ACTION_TYPE_FAILED_TEMPLATE_NOT_EXISTS_IN_CURRENT_DC=The specified Template doesn't exist in the current Data Center. Line 254: ACTION_TYPE_FAILED_TEMPLATE_CANNOT_BE_CREATED_WITH_EMPTY_DISK_ALIAS=Cannot create a template with an empty disk's alias Shouldn't this be "Cannot {action} {type}" etc? Line 255: ACTION_TYPE_FAILED_IMAGE_ALREADY_EXISTS=Cannot ${action} ${type}. One of the Template Images already exists. Line 256: ACTION_TYPE_FAILED_TEMPLATE_GUID_ALREADY_EXISTS=Cannot ${action} ${type}. A Template with the same identifier already exists. Line 257: ACTION_TYPE_FAILED_CANDIDATE_ALREADY_EXISTS=Cannot ${action} ${type}. The export candidate already exists in the specified path.\n\ Line 258: - Use the 'Force Override' option to override the existing file. -- To view, visit http://gerrit.ovirt.org/34256 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If20fcbe3ae6507ba1f39c6e336928fb647efeb1e Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Amit Aviram <[email protected]> Gerrit-Reviewer: Allon Mureinik <[email protected]> Gerrit-Reviewer: Amit Aviram <[email protected]> Gerrit-Reviewer: Idan Shaby <[email protected]> Gerrit-Reviewer: Maor Lipchuk <[email protected]> Gerrit-Reviewer: Tal Nisan <[email protected]> Gerrit-Reviewer: Vered Volansky <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
