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 <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Greg Padgett <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Ori Liel <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches