Omer Frenkel has posted comments on this change.

Change subject: engine: Host name validation cleanup
......................................................................


Patch Set 2: (3 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java
Line 287:             
addCanDoActionMessage(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID);
Line 288:             returnValue = false;
Line 289:         } else {
Line 290:             VDS vds = getParameters().getvds();
Line 291:             if(!validateVdsName(vds)) {
please use formatter
Line 292:                 returnValue = false;
Line 293:             } else if 
(!ValidationUtils.validHostname(vds.gethost_name())) {
Line 294:                 
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_INVALID_VDS_HOSTNAME);
Line 295:                 returnValue = false;


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVdsCommand.java
Line 48:                     _oldVds.getstatus())) {
Line 49:                 if 
("".equals(getParameters().getVdsStaticData().getvds_name())) {
Line 50:                     
addCanDoActionMessage(VdcBllMessages.VDS_TRY_CREATE_WITH_EXISTING_PARAMS);
Line 51:                 }
Line 52:                 if(!validateVdsName(getParameters().getvds())) {
also here
Line 53:                     returnValue = false;
Line 54:                 } else if (_oldVds.getstatus() != 
VDSStatus.InstallFailed
Line 55:                         && 
!_oldVds.gethost_name().equals(getParameters().getvds().gethost_name())) {
Line 56:                     
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_HOSNAME_CANNOT_CHANGE);


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsCommand.java
Line 196:         
getReturnValue().getFault().setMessage(returnValue.getVdsError().getMessage());
Line 197:         
getReturnValue().getExecuteFailedMessages().add(returnValue.getVdsError().getMessage());
Line 198:     }
Line 199: 
Line 200:     public boolean validateVdsName(final VDS vds) {
aren't the size check covered in the entity bean validation? why its needed at 
all? (duplicate validation is important, though)
Line 201:         final String vdsName = vds.getName();
Line 202:         final int maxVdsNameLength = Config.<Integer> 
GetValue(ConfigValues.MaxVdsNameLength);
Line 203:         if (vdsName == null || vdsName.isEmpty()) {
Line 204:             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_NAME_MAY_NOT_BE_EMPTY);


--
To view, visit http://gerrit.ovirt.org/11189
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I5288bfd8020c8339d9d8870c6551b63351be79e4
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to