Alon Bar-Lev has posted comments on this change. Change subject: notifier: modify the oid schema for SNMP notification. ......................................................................
Patch Set 6: (2 comments) http://gerrit.ovirt.org/#/c/32951/6/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/transport/snmp/Snmp.java File backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/transport/snmp/Snmp.java: Line 203: Line 204: private void addString(PDU v2pdu, OID prefix, int suffix, String val, boolean allowEmpty) { Line 205: if (allowEmpty || !StringUtils.isEmpty(val)) { Line 206: v2pdu.add(new VariableBinding(new OID(prefix).append(suffix), new OctetString(val == null ? "" : val))); Line 207: } consider: String sval = val == null ? null : val.toString(); // continue as usual with sval Line 208: } Line 209: Line 210: private void addInt(PDU v2pdu, OID prefix, int suffix, Integer val, boolean allowEmpty) { Line 211: if (allowEmpty || val != null) { Line 214: } Line 215: Line 216: private void addUuid(PDU v2pdu, final OID prefix, int suffix, Guid val) { Line 217: if (!Guid.Empty.equals(val)) { Line 218: addString(v2pdu, prefix, suffix, val.toString(), false); but this is invalid if val == null, because of that I preferred to have addString accept Object. Line 219: } Line 220: } Line 221: Line 222: private static class Host { -- To view, visit http://gerrit.ovirt.org/32951 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic8a06063f8ebbbe4d05783cb25036e870a6be3b7 Gerrit-PatchSet: 6 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: mooli tayer <[email protected]> Gerrit-Reviewer: Alon Bar-Lev <[email protected]> Gerrit-Reviewer: Barak Azulay <[email protected]> Gerrit-Reviewer: Martin Peřina <[email protected]> Gerrit-Reviewer: Oved Ourfali <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: mooli tayer <[email protected]> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
