Mod aaa-12 修复华为设备无法连接的问题。

RCA:
SOL:
修改人:dongxiancun
检视人:dongxiancun
This commit is contained in:
dongxiancun 2019-08-26 16:54:38 +08:00
parent ac4301942a
commit 7f21167a59
1 changed files with 9 additions and 2 deletions

View File

@ -106,7 +106,9 @@ public class HuaweiNetconfSpeaker implements DataTreeChangeListener<ConnectorInf
/**create netconf node with connect device information */ /**create netconf node with connect device information */
final NetconfNodeBuilder netconfNodeBuilder = new NetconfNodeBuilder(); final NetconfNodeBuilder netconfNodeBuilder = new NetconfNodeBuilder();
netconfNodeBuilder.setHost(new Host(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress(connectDevice.getIp().getIpv4Address()))) netconfNodeBuilder.setHost(new Host(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress(connectDevice.getIp().getIpv4Address())))
.setPort(new PortNumber(connectDevice.getPort().getValue())); .setPort(new PortNumber(connectDevice.getPort().getValue()))
.setTcpOnly(false)
.setSchemaless(false);
String username = connectDevice.getUserName(); String username = connectDevice.getUserName();
String password = connectDevice.getPassword(); String password = connectDevice.getPassword();
if (Strings.isNullOrEmpty(username) || Strings.isNullOrEmpty(password)) { if (Strings.isNullOrEmpty(username) || Strings.isNullOrEmpty(password)) {
@ -210,7 +212,11 @@ public class HuaweiNetconfSpeaker implements DataTreeChangeListener<ConnectorInf
} else if (rootNode.getModificationType() == DELETE) { } else if (rootNode.getModificationType() == DELETE) {
LOG.info("onDataTreeChanged - Toaster config with path {} was deleted: old Toaster: {}", LOG.info("onDataTreeChanged - Toaster config with path {} was deleted: old Toaster: {}",
change.getRootPath().getRootIdentifier(), rootNode.getDataBefore()); change.getRootPath().getRootIdentifier(), rootNode.getDataBefore());
disConnectDevice(device.getId().getValue()); ConnectorInfo oldEntry = rootNode.getDataBefore();
oldEntry.getRemoteDevices().forEach( d -> {
disConnectDevice(d.getId().getValue());
});
} }
} }
} }
@ -302,6 +308,7 @@ public class HuaweiNetconfSpeaker implements DataTreeChangeListener<ConnectorInf
InstanceIdentifier<CpuInfos> iid = InstanceIdentifier<CpuInfos> iid =
InstanceIdentifier.create(Devm.class).child(CpuInfos.class); InstanceIdentifier.create(Devm.class).child(CpuInfos.class);
Optional<CpuInfos> cupInfos; Optional<CpuInfos> cupInfos;
LOG.info("开始向华为设备获取cpu信息");
try { try {
// Read from a transaction is asynchronous, but a simple // Read from a transaction is asynchronous, but a simple
// get/checkedGet makes the call synchronous // get/checkedGet makes the call synchronous