Ori Liel has posted comments on this change.

Change subject: core, restapi: Convert NFS version to enum
......................................................................


Patch Set 6: (2 inline comments)

....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendCapabilitiesResource.java
Line 260:         for (NfsVersion nfsVersion : nfsVersions) {
Line 261:             
version.getNfsVersions().getNfsVersions().add(nfsVersion.value());
Line 262:         }
Line 263:     }
Line 264: 
Sorry for not commenting on this before, but if this is a 3.1 feature you 
should add :

if (VersionUtils.greaterOrEqual(version, VERSION_3_1)) {

(see for example addNetworkUsages() in the same class)
Line 265:     private void addnetworkBootProtocols(VersionCaps version, 
BootProtocol[] values) {
Line 266:         version.setBootProtocols(new BootProtocols());
Line 267:         for (BootProtocol bootProtocol : values) {
Line 268:             
version.getBootProtocols().getBootProtocols().add(bootProtocol.value());


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/validation/StorageDomainValidator.java
Line 33:                         validateEnum(NfsVersion.class, 
storage.getNfsVersion(), true);
Line 34:                     }
Line 35:                 }
Line 36:             }
Line 37:         }
Again, sorry for not commenting already in the previous patch set - 

The enum validators are very 'stupid'. All that they care about is that string 
that the user supplies maps correctly to the enum it's associated with. 


You add here also a business validation, which is correct but not necessary in 
this context. Here would be enough: 

if (storageDomain.isSetStorage() && 
storageDomain.getStorage().isSetNfsVersion() {
  validateEnum(NfsVersion.class, storage.getNfsVersion(), true);
}
Line 38:     }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I09d82db7c0ec92135cae8935f013487e97b8f357
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Greg Padgett <gpadg...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Ayal Baron <aba...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Greg Padgett <gpadg...@redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com>
Gerrit-Reviewer: Ori Liel <ol...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to