brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject [1/2] incubator-brooklyn git commit: Fix NPE if loginUser is not present and useJcloudsSshInit is false
Date Wed, 21 Oct 2015 21:14:36 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master e3553a1df -> 24b0f3e8a


Fix NPE if loginUser is not present and useJcloudsSshInit is false


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

Branch: refs/heads/master
Commit: e07411973fc284c0f4c3d4cdee1fc00f4d8780c3
Parents: e3553a1
Author: Yavor Yanchev <yavor@yanchev.com>
Authored: Wed Oct 21 21:02:00 2015 +0300
Committer: Yavor Yanchev <yavor@yanchev.com>
Committed: Wed Oct 21 21:02:00 2015 +0300

----------------------------------------------------------------------
 .../brooklyn/location/jclouds/JcloudsLocation.java      | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e0741197/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
index 0705d26..4c3297d 100644
--- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
+++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
@@ -2515,8 +2515,16 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
         LoginCredentials nodeCreds = node.getCredentials();
         String nodeUser = nodeCreds.getUser();
         String loginUserOverride = setup.get(LOGIN_USER);
-        Set<String> users = MutableSet.<String>builder().add(nodeUser).add(loginUserOverride).build();
-        
+        Set<String> users = MutableSet.of();
+
+        if (Strings.isNonBlank(nodeUser)) {
+            users.add(nodeUser);
+        }
+
+        if (Strings.isNonBlank(loginUserOverride)) {
+            users.add(loginUserOverride);
+        }
+
         // See https://issues.apache.org/jira/browse/BROOKLYN-186
         // Handle where jclouds gives us the wrong login user (!) and both a password + ssh
key.
         // Try all the permutations to find the one that works.


Mime
View raw message