brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjcorb...@apache.org
Subject [1/2] brooklyn-server git commit: Set the username for Windows locations correctly
Date Thu, 02 Mar 2017 17:57:21 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/master 3a6a2ee83 -> 1aa222a97


Set the username for Windows locations correctly

The username when deploying to a winrm target is always empty. Fix it by following the same
approach the SSH branch takes to populate the username.


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

Branch: refs/heads/master
Commit: 90d9137acf640d4bf53bc46a6f86898894d45a3d
Parents: b3397aa
Author: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Authored: Thu Mar 2 18:53:36 2017 +0200
Committer: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Committed: Thu Mar 2 18:53:36 2017 +0200

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


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/90d9137a/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 8e25d64..600a710 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
@@ -2051,6 +2051,9 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
         String address = winrmHostAndPort.getHostText();
         String displayName = getPublicHostnameGeneric(node, setup, Optional.of(address));
 
+        final Object password = winrmConfig.get(WinRmMachineLocation.PASSWORD.getName())
!= null
+                ? winrmConfig.get(WinRmMachineLocation.PASSWORD.getName())
+                : userCredentials.getOptionalPassword().orNull();
         if (isManaged()) {
             final LocationSpec<JcloudsWinRmMachineLocation> spec = LocationSpec.create(JcloudsWinRmMachineLocation.class)
                     .configure(winrmConfig)
@@ -2058,11 +2061,8 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
                     .configure("displayName", displayName)
                     .configure("address", address)
                     .configure(WinRmMachineLocation.WINRM_CONFIG_PORT, winrmHostAndPort.getPort())
-                    .configure("user", getUser(setup))
-                    .configure(WinRmMachineLocation.USER, setup.get(USER))
-                    .configure(SshMachineLocation.PASSWORD.getName(), winrmConfig.get(WinRmMachineLocation.PASSWORD.getName())
!= null ?
-                            winrmConfig.get(WinRmMachineLocation.PASSWORD.getName()) :
-                            userCredentials.getOptionalPassword().orNull())
+                    .configure(WinRmMachineLocation.USER.getName(), userCredentials.getUser())
+                    .configure(WinRmMachineLocation.PASSWORD.getName(), password)
                     .configure("node", node)
                     .configureIfNotNull(CLOUD_AVAILABILITY_ZONE_ID, nodeAvailabilityZone)
                     .configureIfNotNull(CLOUD_REGION_ID, nodeRegion)


Mime
View raw message