Do a proper disconnect when deleting a connector. 68/46668/1
authorTomas Cere <tcere@cisco.com>
Fri, 7 Oct 2016 11:36:06 +0000 (13:36 +0200)
committerTomas Cere <tcere@cisco.com>
Fri, 7 Oct 2016 11:36:06 +0000 (13:36 +0200)
Change-Id: I1abba51e331eb1f019e5f2fe741f3836f840aae1
Signed-off-by: Tomas Cere <tcere@cisco.com>
(cherry picked from commit fc129a55005ce9d0c1cacfb2538e71fbe56ddd2a)

opendaylight/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/listener/NetconfDeviceCommunicator.java

index aa8afbc664ac362a3667b724e41cf8b8e69379fc..5fdd9d600cf3c20ed6b53c82f1427fe24459e425 100644 (file)
@@ -241,10 +241,8 @@ public class NetconfDeviceCommunicator implements NetconfClientSessionListener,
             initFuture.cancel(false);
         }
         // Disconnect from device
-        if(session != null) {
-            session.close();
-            // tear down not necessary, called indirectly by above close
-        }
+        // tear down not necessary, called indirectly by the close in disconnect()
+        disconnect();
     }
 
     @Override