BUG-3878 Prevent null pointer in nc for unresolved addresses 95/24095/4
authorMaros Marsalek <mmarsale@cisco.com>
Tue, 14 Jul 2015 11:27:23 +0000 (13:27 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 22 Jul 2015 07:37:00 +0000 (07:37 +0000)
Unresolved address is not a reason for config pusher failure. Use host string
instead of resolved address string representation.

Change-Id: Ieba345077860cd55325ca49980c3fb9edd66051c
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/util/RemoteDeviceId.java

index 6bc84f101595c32a5fc0b028868940165d082db9..d1c107c3a4c0c5a353d040675ca0e5aab1eaf46f 100644 (file)
@@ -105,9 +105,7 @@ public final class RemoteDeviceId {
     }
 
     private Host buildHost() {
-        return address.getAddress().getHostAddress() != null
-                ? HostBuilder.getDefaultInstance(address.getAddress().getHostAddress())
-                : HostBuilder.getDefaultInstance(address.getAddress().getHostName());
+        return HostBuilder.getDefaultInstance(address.getHostString());
     }
 
     public String getName() {