Arista Driver add log & Modification of some information
Change-Id: I37657bb906ae555ddfb59dd461bb8d659bba8f61
diff --git a/drivers/arista/src/main/java/org/onosproject/drivers/arista/DeviceDescriptionDiscoveryAristaImpl.java b/drivers/arista/src/main/java/org/onosproject/drivers/arista/DeviceDescriptionDiscoveryAristaImpl.java
index be2d6a0..bdc0e91 100644
--- a/drivers/arista/src/main/java/org/onosproject/drivers/arista/DeviceDescriptionDiscoveryAristaImpl.java
+++ b/drivers/arista/src/main/java/org/onosproject/drivers/arista/DeviceDescriptionDiscoveryAristaImpl.java
@@ -105,18 +105,20 @@
@Override
public List<PortDescription> discoverPortDetails() {
+
Map<String, MacAddress> macAddressMap = getMacAddressesByInterface();
List<PortDescription> ports = Lists.newArrayList();
+ DeviceId deviceId = checkNotNull(handler().data().deviceId());
try {
Optional<JsonNode> result = AristaUtils.retrieveCommandResult(handler(), SHOW_INTERFACES_STATUS);
if (!result.isPresent()) {
+ log.warn("{} Device unable to get interfaces status information.", deviceId);
return ports;
}
JsonNode jsonNode = result.get().findValue(INTERFACE_STATUSES);
-
jsonNode.fieldNames().forEachRemaining(name -> {
JsonNode interfaceNode = jsonNode.get(name);
@@ -170,12 +172,15 @@
}
private Map<String, MacAddress> getMacAddressesByInterface() {
+
+ DeviceId deviceId = checkNotNull(handler().data().deviceId());
Map<String, MacAddress> macAddressMap = new HashMap();
try {
Optional<JsonNode> result = AristaUtils.retrieveCommandResult(handler(), SHOW_INTERFACES);
if (!result.isPresent()) {
+ log.warn("{} Device unable to get interface information.", deviceId);
return macAddressMap;
}