Do a proper disconnect when deleting a connector. 67/46667/1
authorTomas Cere <tcere@cisco.com>
Fri, 7 Oct 2016 10:21:43 +0000 (12:21 +0200)
committerTomas Cere <tcere@cisco.com>
Fri, 7 Oct 2016 11:29:51 +0000 (11:29 +0000)
Change-Id: I1abba51e331eb1f019e5f2fe741f3836f840aae1
Signed-off-by: Tomas Cere <tcere@cisco.com>
(cherry picked from commit fc129a55005ce9d0c1cacfb2538e71fbe56ddd2a)

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

index 93ac945f2d2c9c9cc8479796ada6a27906bab102..91407a573298a3ee83f81c29a7f098913c442620 100644 (file)
@@ -246,10 +246,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