Repository: brooklyn-server Updated Branches: refs/heads/0.8.0-incubating [created] 1eb677540
JcloudsLocation#registerMachine handles Windows machines Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/7fe9b572 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/7fe9b572 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/7fe9b572 Branch: refs/heads/0.8.0-incubating Commit: 7fe9b5720d195dfc8aba4a972577a1fdf8630a19 Parents: 8ef103e Author: Sam Corbett <[email protected]> Authored: Tue Aug 18 18:32:40 2015 +0100 Committer: Sam Corbett <[email protected]> Committed: Fri Aug 21 10:16:43 2015 +0100 ---------------------------------------------------------------------- .../apache/brooklyn/location/jclouds/JcloudsLocation.java | 10 +++++++--- .../jclouds/JcloudsLocationRebindMachineLiveTest.java | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/7fe9b572/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 867d349..21d4760 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 @@ -1903,9 +1903,9 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im * <p> * Required fields are: * <ul> - * <li>id: the jclouds VM id, e.g. "eu-west-1/i-5504f21d" (NB this is @see JcloudsSshMachineLocation#getJcloudsId() not #getId()) + * <li>id: the jclouds VM id, e.g. "eu-west-1/i-5504f21d" (NB this is {@see JcloudsMachineLocation#getJcloudsId()} not #getId()) * <li>hostname: the public hostname or IP of the machine, e.g. "ec2-176-34-93-58.eu-west-1.compute.amazonaws.com" - * <li>userName: the username for ssh'ing into the machine + * <li>userName: the username for sshing into the machine if it is not a Windows system * <ul> */ public MachineLocation registerMachine(ConfigBag setup) throws NoMachinesAvailableException { @@ -1941,7 +1941,11 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im // TODO confirm we can SSH ? // NB if rawHostname not set, get the hostname using getPublicHostname(node, Optional.<HostAndPort>absent(), setup); - return registerJcloudsSshMachineLocation(computeService, node, null, Optional.<HostAndPort>absent(), setup); + if (isWindows(node, setup)) { + return registerWinRmMachineLocation(computeService, node, null, Optional.<HostAndPort>absent(), setup); + } else { + return registerJcloudsSshMachineLocation(computeService, node, null, Optional.<HostAndPort>absent(), setup); + } } catch (IOException e) { throw Exceptions.propagate(e); http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/7fe9b572/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsLocationRebindMachineLiveTest.java ---------------------------------------------------------------------- diff --git a/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsLocationRebindMachineLiveTest.java b/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsLocationRebindMachineLiveTest.java index bf9ad59..6d891a6 100644 --- a/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsLocationRebindMachineLiveTest.java +++ b/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsLocationRebindMachineLiveTest.java @@ -52,7 +52,7 @@ public class JcloudsLocationRebindMachineLiveTest extends AbstractJcloudsLiveTes @Test(groups = { "Live", "Live-sanity" }) public void testRebindWithIncorrectId() throws Exception { try { - jcloudsLocation.rebindMachine(ImmutableMap.of("id", "incorrectid", "hostname", "myhostname", "user", "myusername")); + jcloudsLocation.registerMachine(ImmutableMap.of("id", "incorrectid", "hostname", "myhostname", "user", "myusername")); } catch (IllegalArgumentException e) { if (e.getMessage().contains("node not found")) { // success
