Mike Kolesnik has posted comments on this change. Change subject: engine: Read "vlanid" and "interface" from VLAN information ......................................................................
Patch Set 6: (3 comments) http://gerrit.ovirt.org/#/c/26606/6//COMMIT_MSG Commit Message: Line 6: Line 7: engine: Read "vlanid" and "interface" from VLAN information Line 8: Line 9: If vsdm reports vlanid as an independent field the engine should use it Line 10: instead of deducting it from vlan name. s/deducting/deducing/ Line 11: Line 12: Change-Id: I282c2db9a0fd023ac39fac157ce1c0178800d3af Line 13: Bug-Url: https://bugzilla.redhat.com/1091863 Line 14: Bug-Url: https://bugzilla.redhat.com/999975 http://gerrit.ovirt.org/#/c/26606/6/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java File backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java: Line 1210: iface.setVdsId(vds.getId()); Line 1211: Line 1212: Map<String, Object> vlan = (Map<String, Object>) entry.getValue(); Line 1213: Line 1214: if (vlan.get(VdsProperties.VLAN_ID) != null) { I'd check if these properties both exist, and only then try to get them. Line 1215: iface.setVlanId((Integer) vlan.get(VdsProperties.VLAN_ID)); Line 1216: iface.setBaseInterface((String) vlan.get(VdsProperties.BASE_INTERFACE)); Line 1217: } else { Line 1218: if (vlanDeviceName.contains(".")) { Line 1213: Line 1214: if (vlan.get(VdsProperties.VLAN_ID) != null) { Line 1215: iface.setVlanId((Integer) vlan.get(VdsProperties.VLAN_ID)); Line 1216: iface.setBaseInterface((String) vlan.get(VdsProperties.BASE_INTERFACE)); Line 1217: } else { You can simplify to "else if" Line 1218: if (vlanDeviceName.contains(".")) { Line 1219: String[] names = vlanDeviceName.split("[.]", -1); Line 1220: String vlanId = names[1]; Line 1221: iface.setVlanId(Integer.parseInt(vlanId)); -- To view, visit http://gerrit.ovirt.org/26606 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I282c2db9a0fd023ac39fac157ce1c0178800d3af Gerrit-PatchSet: 6 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alona Kaplan <alkap...@redhat.com> Gerrit-Reviewer: Mike Kolesnik <mkole...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches