diff --git a/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfDeviceInfo.java b/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfDeviceInfo.java index 3ef4e602fc..17849fc80a 100644 --- a/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfDeviceInfo.java +++ b/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfDeviceInfo.java @@ -126,8 +126,9 @@ public class NetconfDeviceInfo { /** * Convenieince constructor that converts all known fields from NetCfg data. * @param netconfConfig NetCf configuration + * @param deviceId deviceId as per netcfg */ - public NetconfDeviceInfo(NetconfDeviceConfig netconfConfig) { + public NetconfDeviceInfo(NetconfDeviceConfig netconfConfig, DeviceId deviceId) { checkArgument(!netconfConfig.username().isEmpty(), "Empty device name"); checkArgument(netconfConfig.port() > 0, "Negative port"); checkNotNull(netconfConfig.ip(), "Null ip address"); @@ -135,6 +136,7 @@ public class NetconfDeviceInfo { this.name = netconfConfig.username(); this.password = netconfConfig.password(); this.ipAddress = netconfConfig.ip(); + this.deviceId = deviceId; this.port = netconfConfig.port(); this.path = netconfConfig.path(); if (netconfConfig.sshKey() != null && !netconfConfig.sshKey().isEmpty()) { diff --git a/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfControllerImpl.java b/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfControllerImpl.java index c32004c248..cb0a71237b 100644 --- a/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfControllerImpl.java +++ b/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfControllerImpl.java @@ -370,7 +370,7 @@ public class NetconfControllerImpl implements NetconfController { if (netCfg != null) { log.debug("Device {} is present in NetworkConfig", deviceId); - deviceInfo = new NetconfDeviceInfo(netCfg); + deviceInfo = new NetconfDeviceInfo(netCfg, deviceId); } else { log.debug("Creating NETCONF device {}", deviceId); deviceInfo = createDeviceInfo(deviceId);