Yair Zaslavsky has posted comments on this change.
Change subject: engine: check if host exists with same name
......................................................................
Patch Set 1: (1 inline comment)
Minor comment.
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java
Line 300: // check that VDS hostname does not contain special
characters.
Line 301: } else if (!ValidationUtils.validHostname(hostName)) {
Line 302:
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_INVALID_VDS_HOSTNAME);
Line 303: returnValue = false;
Line 304: } else
if(!getDbFacade().getVdsDao().getAllWithName(vdsName).isEmpty()) {
Kinda makes getAllWithName which returns a list redundant, right?
As no such host can exist, due to unique constraint.
Please change this and just retrieve the host by name (i.e - method that will
return a single object or null).
Thanks!
Line 305:
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_DUPLICATE_VDS_NAME);
Line 306: returnValue = false;
Line 307: } else {
Line 308: returnValue = returnValue &&
validateSingleHostAttachedToLocalStorage();
--
To view, visit http://gerrit.ovirt.org/10910
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I4791d49b128126269d9b2b0c2e9bb35debf5a7ec
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches