You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by ri...@apache.org on 2015/07/27 12:25:02 UTC

[2/4] incubator-brooklyn git commit: Fix jclouds createUser, with password override

Fix jclouds createUser, with password override

Previously if the createUser was configured to use a specific password
for that new user, then it would also try to login to run the
createUser command using that password (rather that use the contents
of the initialCredentials).


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

Branch: refs/heads/master
Commit: 2f9e0e66ccf0dc92d526cb67b87bbf8e39d8551c
Parents: cee066e
Author: Aled Sage <al...@gmail.com>
Authored: Mon Jul 13 16:35:07 2015 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Mon Jul 13 17:36:24 2015 +0100

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


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2f9e0e66/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java b/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java
index 214f946..966cb4a 100644
--- a/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java
+++ b/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java
@@ -1531,8 +1531,16 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
                 sshProps.put("user", initialUser);
                 sshProps.put("address", address);
                 sshProps.put("port", port);
-                if (initialPassword.isPresent()) sshProps.put("password", initialPassword.get());
-                if (initialPrivateKey.isPresent()) sshProps.put("privateKeyData", initialPrivateKey.get());
+                if (initialPassword.isPresent()) {
+                    sshProps.put("password", initialPassword.get());
+                } else {
+                    sshProps.remove("password");
+                }
+                if (initialPrivateKey.isPresent()) {
+                    sshProps.put("privateKeyData", initialPrivateKey.get());
+                } else {
+                    sshProps.remove("privateKeyData");
+                }
     
                 // TODO Retrying lots of times as workaround for vcloud-director. There the guest customizations
                 // can cause the VM to reboot shortly after it was ssh'able.