Currently in the readLLDP function, when looping over all neighbours in
nbrList, if createR2RLink for one neighbour fails, the whole function
returns which means that the rest of the neighbors in nbrList are never
processed. I think it makes more sense to continue the loop and create
R2R links for other neighbors. This patch proposes to do that while
still returning false if one createR2RLink fails.
Signed-off-by: Jonas Mårtensson <jonas.martensson@ri.se>
Change-Id: I73d587cc52c1b11e449baf3c69c9179a7dc2483d
}
NbrList nbrList = protocolObject.get().augmentation(Protocols1.class).getLldp().getNbrList();
LOG.info("LLDP subtree is present. Device has {} neighbours", nbrList.getIfName().size());
}
NbrList nbrList = protocolObject.get().augmentation(Protocols1.class).getLldp().getNbrList();
LOG.info("LLDP subtree is present. Device has {} neighbours", nbrList.getIfName().size());
+ boolean success = true;
for (IfName ifName : nbrList.getIfName()) {
if (ifName.getRemoteSysName() == null) {
LOG.warn("LLDP subtree neighbour is empty for nodeId: {}, ifName: {}",
for (IfName ifName : nbrList.getIfName()) {
if (ifName.getRemoteSysName() == null) {
LOG.warn("LLDP subtree neighbour is empty for nodeId: {}, ifName: {}",
ifName.getRemotePortId())) {
LOG.error("Link Creation failed between {} and {} nodes.", nodeId.getValue(),
ifName.getRemoteSysName());
ifName.getRemotePortId())) {
LOG.error("Link Creation failed between {} and {} nodes.", nodeId.getValue(),
ifName.getRemoteSysName());
}
else if (nodeVersion.equals(OPENROADM_DEVICE_VERSION_2_2_1)) {
InstanceIdentifier<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.openroadm.device
}
else if (nodeVersion.equals(OPENROADM_DEVICE_VERSION_2_2_1)) {
InstanceIdentifier<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.openroadm.device
= protocolObject.get().augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev181019
.Protocols1.class).getLldp().getNbrList();
LOG.info("LLDP subtree is present. Device has {} neighbours", nbrList.getIfName().size());
= protocolObject.get().augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev181019
.Protocols1.class).getLldp().getNbrList();
LOG.info("LLDP subtree is present. Device has {} neighbours", nbrList.getIfName().size());
+ boolean success = true;
for (org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev181019.lldp.container.lldp.nbr.list.IfName
ifName : nbrList.getIfName()) {
if (ifName.getRemoteSysName() == null) {
for (org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev181019.lldp.container.lldp.nbr.list.IfName
ifName : nbrList.getIfName()) {
if (ifName.getRemoteSysName() == null) {
ifName.getRemotePortId())) {
LOG.error("Link Creation failed between {} and {} nodes.", nodeId, ifName
.getRemoteSysName());
ifName.getRemotePortId())) {
LOG.error("Link Creation failed between {} and {} nodes.", nodeId, ifName
.getRemoteSysName());
}
else {
LOG.error("Unable to read LLDP data for unmanaged openroadm device version");
}
else {
LOG.error("Unable to read LLDP data for unmanaged openroadm device version");