Cosmetic fixes and logging around Juniper driver
Change-Id: Ief0dba3a1c4cc567cf9fe6fa16b4aeae9488c51e
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 2b99faa..1c9f208 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
@@ -19,7 +19,6 @@
import com.google.common.annotations.Beta;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
-import org.onosproject.drivers.utilities.XmlConfigParser;
import org.onosproject.net.Device;
import org.onosproject.net.DeviceId;
import org.onosproject.net.Port;
@@ -31,7 +30,6 @@
import org.onosproject.netconf.NetconfSession;
import org.slf4j.Logger;
-import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.HashSet;
import java.util.Optional;
@@ -41,6 +39,7 @@
import static org.onosproject.drivers.juniper.JuniperUtils.LinkAbstraction;
import static org.onosproject.drivers.juniper.JuniperUtils.parseJuniperLldp;
import static org.onosproject.drivers.juniper.JuniperUtils.requestBuilder;
+import static org.onosproject.drivers.utilities.XmlConfigParser.loadXmlString;
import static org.onosproject.net.AnnotationKeys.PORT_NAME;
import static org.onosproject.drivers.juniper.JuniperUtils.REQ_LLDP_NBR_INFO;
import static org.slf4j.LoggerFactory.getLogger;
@@ -72,8 +71,7 @@
return ImmutableSet.of();
}
log.debug("Reply from device {} : {}", localDeviceId, reply);
- Set<LinkAbstraction> linkAbstractions = parseJuniperLldp(
- XmlConfigParser.loadXml(new ByteArrayInputStream(reply.getBytes())));
+ Set<LinkAbstraction> linkAbstractions = parseJuniperLldp(loadXmlString(reply));
log.debug("Set of LinkAbstraction discovered {}", linkAbstractions);
DeviceService deviceService = this.handler().get(DeviceService.class);
@@ -126,9 +124,9 @@
JuniperUtils.createBiDirLinkDescription(localDeviceId,
localPort.get(),
- remoteDevice.id(),
- remotePort.get(),
- descriptions);
+ remoteDevice.id(),
+ remotePort.get(),
+ descriptions);
}
return descriptions;