From 204069e28ae7a784955f69d272777bbe367b163c Mon Sep 17 00:00:00 2001 From: Ivan Hrasko Date: Fri, 3 Nov 2023 13:48:13 +0100 Subject: [PATCH] Close device handler when it fails to connect Close RemoteDeviceHandler instance and thus delete operational data for device from data-store when we failed to establish connection, for example because of wrong password format used. JIRA: NETCONF-1114 Change-Id: I9db06595a3867ec04ad30aa76b7a5b21c75b7a8f Signed-off-by: Ivan Hrasko --- .../netconf/topology/spi/AbstractNetconfTopology.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/netconf-topology/src/main/java/org/opendaylight/netconf/topology/spi/AbstractNetconfTopology.java b/apps/netconf-topology/src/main/java/org/opendaylight/netconf/topology/spi/AbstractNetconfTopology.java index 43921f32f5..b7bcc26313 100644 --- a/apps/netconf-topology/src/main/java/org/opendaylight/netconf/topology/spi/AbstractNetconfTopology.java +++ b/apps/netconf-topology/src/main/java/org/opendaylight/netconf/topology/spi/AbstractNetconfTopology.java @@ -130,7 +130,8 @@ public abstract class AbstractNetconfTopology { } catch (IllegalArgumentException e) { // This is a workaround for NETCONF-1114 where the encrypted password's lexical structure is not enforced // in the datastore and it ends up surfacing when we decrypt the password. - LOG.warn("RemoteDevice{{}} failed to connect", nodeId, e); + LOG.warn("RemoteDevice{{}} failed to connect, removing from operational datastore", nodeId, e); + deviceSalFacade.close(); return; } -- 2.36.6