Roy Golan has posted comments on this change. Change subject: core: osinfo - Remove Unassigned and map it to Other ......................................................................
Patch Set 4: (5 inline comments) Michael - please supply some details about the doc bugr .................................................... File backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/model/OsTypeUtils.java Line 19: for (String uniqueName : osRepository.getUniqueOsNames().values()) { Line 20: osTypeValues.add(uniqueName); Line 21: } Line 22: for (OsType type : OsType.values()) { Line 23: osTypeValues.add(type.value().toLowerCase()); correct this is redundant Line 24: } Line 25: } Line 26: Line 27: private OsTypeUtils() { .................................................... File backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/validation/OsValidator.java Line 15: @Override Line 16: public void validateEnums(OperatingSystem os) { Line 17: if (os != null) { Line 18: if (os.isSetType()) { Line 19: validateEnum(OsType.class, OsTypeUtils.getAllValues(), os.getType(), false); this works exactly as expected (verified) - when I try to put os with uppercase I fail and lowercase is all good Line 20: } Line 21: if (os.isSetBoot()) { Line 22: for (Boot boot : os.getBoot()) { Line 23: bootValidator.validateEnums(boot); .................................................... File backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java Line 245: OsType osType = OsType.fromValue(type); Line 246: if (osType != null) { Line 247: return map(osType,Integer.class); Line 248: } else { Line 249: return SimpleDependecyInjector.getInstance().get(OsRepository.class).getOsIdByUniqueName(type); it can but its unlikely because the mapper is post validation phase (which was also updated) Line 250: } Line 251: } Line 252: Line 253: @Mapping(from = VmAffinity.class, to = MigrationSupport.class) Line 307: entity.getKernelParams() != null) { Line 308: OperatingSystem os = new OperatingSystem(); Line 309: Line 310: os.setType(SimpleDependecyInjector.getInstance().get(OsRepository.class).getUniqueOsNames().get(entity.getVmOsId())); Line 311: yes they are - each os inserted to the BE os repository has a uniquename which is being used in the rest as the type. all values have see in this patchset the file osinfo-defaults.properties Line 312: os.setKernel(entity.getKernelUrl()); Line 313: os.setInitrd(entity.getInitrdUrl()); Line 314: os.setCmdline(entity.getKernelParams()); Line 315: model.setOs(os); .................................................... File backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/utils/OsTypeMockUtils.java Line 16 Line 17 Line 18 Line 19 Line 20 that method is not in use anymore . It was valid when there was a difference between the BE names and the REST names. -- To view, visit http://gerrit.ovirt.org/16679 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie508a8828caedf4cb8fdf971e14139404f7dded3 Gerrit-PatchSet: 4 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Roy Golan <rgo...@redhat.com> Gerrit-Reviewer: Itamar Heim <ih...@redhat.com> Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com> Gerrit-Reviewer: Michal Skrivanek <michal.skriva...@redhat.com> Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com> Gerrit-Reviewer: Roy Golan <rgo...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches