brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From drigod...@apache.org
Subject [1/2] brooklyn-server git commit: fix npe that can occur with WinRM when no subnet IP, do a better job of returning public IP but above all don't NPE
Date Fri, 08 Sep 2017 11:40:45 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/master 36de666d2 -> 25312b16a


fix npe that can occur with WinRM when no subnet IP, do a better job of returning public IP
but above all don't NPE


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/232925f2
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/232925f2
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/232925f2

Branch: refs/heads/master
Commit: 232925f21fa0414984752ed26b25185972a8a30c
Parents: 36de666
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Fri Sep 8 10:31:17 2017 +0100
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Fri Sep 8 10:31:17 2017 +0100

----------------------------------------------------------------------
 .../brooklyn/location/jclouds/JcloudsWinRmMachineLocation.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/232925f2/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsWinRmMachineLocation.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsWinRmMachineLocation.java
b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsWinRmMachineLocation.java
index 127cfc6..d491791 100644
--- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsWinRmMachineLocation.java
+++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsWinRmMachineLocation.java
@@ -275,7 +275,10 @@ public class JcloudsWinRmMachineLocation extends WinRmMachineLocation
implements
         if (privateAddress.isPresent()) {
             return privateAddress.get();
         }
-        if (groovyTruth(node.getPublicAddresses())) {
+        if (groovyTruth(publicAddresses)) {
+            return publicAddresses.iterator().next();
+        }
+        if (node!=null && groovyTruth(node.getPublicAddresses())) {
             return node.getPublicAddresses().iterator().next();
         }
         return null;


Mime
View raw message