Ori Liel has posted comments on this change. Change subject: restapi: backward compatibility for cluster's scheduling policy ......................................................................
Patch Set 8: (1 inline comment) .................................................... File backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/ClusterMapper.java Line 166: Line 167: @Mapping(from = VDSGroup.class, to = SchedulingPolicy.class) Line 168: public static SchedulingPolicy map(VDSGroup entity, SchedulingPolicy template) { Line 169: SchedulingPolicy model = template != null ? template : new SchedulingPolicy(); Line 170: if (entity.getClusterPolicyName() != null && !entity.getClusterPolicyName().toLowerCase().equals(NONE)) { Let's take the opportunity to improve a bad existing situation, which is that for non-existing policy user would see: <scheduling_policy/> By removing the second part of the above 'if' statement, user will see: <scheduling_policy> <type>none</type> </scheduling_policy> which is better. Line 171: model.setPolicy(entity.getClusterPolicyName()); Line 172: if (entity.getClusterPolicyProperties() != null) { Line 173: model.setThresholds(new SchedulingPolicyThresholds()); Line 174: String lowUtilization = entity.getClusterPolicyProperties().get(LOW_UTILIZATION); -- To view, visit http://gerrit.ovirt.org/16607 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4edd7313401670ca225b32d19dd7ad961ccd1b6a Gerrit-PatchSet: 8 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com> Gerrit-Reviewer: Laszlo Hornyak <lhorn...@redhat.com> Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com> Gerrit-Reviewer: Ori Liel <ol...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches