[ONOS-8137] Bug fixed for driver not found in case of ipv6 address being used in short notation

Change-Id: I8fd0922eb2cce98ecb5612979f0554ac2281351b
This commit is contained in:
Anurag Chadha 2021-03-26 14:43:41 +05:30 committed by Andrea Campanella
parent b07d88a32f
commit b6a6bcbe12
2 changed files with 4 additions and 2 deletions

View File

@ -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()) {

View File

@ -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);