diff --git a/changelogs/fragments/netconf_reset_connection.yaml b/changelogs/fragments/netconf_reset_connection.yaml new file mode 100644 index 000000000..47d2cfeda --- /dev/null +++ b/changelogs/fragments/netconf_reset_connection.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: + - "netconf - Adds check for netconf session_close RPC happens only if connection is alive." diff --git a/plugins/connection/netconf.py b/plugins/connection/netconf.py index 0fc3184e0..0c8b54def 100644 --- a/plugins/connection/netconf.py +++ b/plugins/connection/netconf.py @@ -430,6 +430,6 @@ def _connect(self): ) def close(self): - if self._manager: + if self._manager and self._manager.connected: self._manager.close_session() super(Connection, self).close()