Clean up logging in (or relevant to) Juniper NETCONF provider
Also fix missing chassisId in DefaultDeviceDescription.toString()
Change-Id: I944baf0b3a4eb9960c0cbcec2ad585701d9a2989
diff --git a/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/DeviceDiscoveryJuniperImpl.java b/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/DeviceDiscoveryJuniperImpl.java
index c60c448..3c254c5 100644
--- a/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/DeviceDiscoveryJuniperImpl.java
+++ b/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/DeviceDiscoveryJuniperImpl.java
@@ -55,10 +55,10 @@
NetconfController controller = checkNotNull(handler().get(NetconfController.class));
NetconfSession session = controller.getDevicesMap().get(devId).getSession();
String sysInfo;
- String chassis;
+ String chassisMacAddresses;
try {
sysInfo = session.get(requestBuilder(REQ_SYS_INFO));
- chassis = session.get(requestBuilder(REQ_MAC_ADD_INFO));
+ chassisMacAddresses = session.get(requestBuilder(REQ_MAC_ADD_INFO));
} catch (NetconfException e) {
log.warn("Failed to retrieve device details for {}", devId);
return null;
@@ -66,8 +66,8 @@
log.trace("Device {} system-information {}", devId, sysInfo);
DeviceDescription description =
JuniperUtils.parseJuniperDescription(devId,
- loadXmlString(sysInfo),
- chassis);
+ loadXmlString(sysInfo),
+ chassisMacAddresses);
log.debug("Device {} description {}", devId, description);
return description;
}
@@ -81,7 +81,7 @@
try {
reply = session.get(requestBuilder(REQ_IF_INFO));
} catch (NetconfException e) {
- log.warn("Failed to retrieve ports for device {}", devId);
+ log.warn("Failed to retrieve interface-information for device {}", devId);
return ImmutableList.of();
}
log.trace("Device {} interface-information {}", devId, reply);
diff --git a/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/LinkDiscoveryJuniperImpl.java b/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/LinkDiscoveryJuniperImpl.java
index ebb683c..bdb8883 100644
--- a/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/LinkDiscoveryJuniperImpl.java
+++ b/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/LinkDiscoveryJuniperImpl.java
@@ -68,7 +68,7 @@
try {
reply = session.get(requestBuilder(REQ_LLDP_NBR_INFO));
} catch (NetconfException e) {
- log.warn("Failed to retrieve ports for device {}", localDeviceId);
+ log.warn("Failed to retrieve lldp-neighbors-information for device {}", localDeviceId);
return ImmutableSet.of();
}
log.debug("Reply from device {} : {}", localDeviceId, reply);
@@ -101,8 +101,8 @@
input -> input.chassisId().equals(linkAbs.remoteChassisId));
if (!dev.isPresent()) {
- log.warn("Device with chassis ID {} does not exist",
- linkAbs.remoteChassisId);
+ log.warn("Device with chassis ID {} does not exist. Referenced by {}/{}",
+ linkAbs.remoteChassisId, localDeviceId, linkAbs);
continue;
}
Device remoteDevice = dev.get();
@@ -132,7 +132,8 @@
return false;
}).findAny();
if (!remotePort.isPresent()) {
- log.warn("Port Index and Port Id and Port description do not exist in device {}", remoteDevice.id());
+ log.warn("Port does not exist in remote device {}. Referenced by {}/{}",
+ remoteDevice.id(), localDeviceId, linkAbs);
continue;
}