undo and document buggy deprecation of WAIT_FOR_SSHABLE

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

Branch: refs/heads/master
Commit: ce061afc6cd30cbc53598895fcdddd7e11e18e2f
Parents: e1778fc
Author: Alex Heneveld <[email protected]>
Authored: Tue Apr 25 17:38:21 2017 +0100
Committer: Alex Heneveld <[email protected]>
Committed: Fri Apr 28 14:09:51 2017 +0100

----------------------------------------------------------------------
 .../core/location/cloud/CloudLocationConfig.java      | 14 ++++++++++----
 .../jclouds/DefaultConnectivityResolverTest.java      |  3 +++
 2 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ce061afc/core/src/main/java/org/apache/brooklyn/core/location/cloud/CloudLocationConfig.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/location/cloud/CloudLocationConfig.java
 
b/core/src/main/java/org/apache/brooklyn/core/location/cloud/CloudLocationConfig.java
index d5051ea..43aa7af 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/location/cloud/CloudLocationConfig.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/location/cloud/CloudLocationConfig.java
@@ -102,14 +102,20 @@ public interface CloudLocationConfig {
                     "Other keys prefixed with 
pollForFirstReachableAddress.predicate.<property> will be passed to the Map 
constructor of the Predicate<HostAndPort> implementation.",
             Networking.IsReachablePredicate.class);
 
-    /** @deprecated since 0.11.0 use {@link #POLL_FOR_FIRST_REACHABLE_ADDRESS} 
instead. */
-    @Deprecated
+    // FIXME we would like to deprecate this but 
POLL_FOR_FIRST_REACHABLE_ADDRESS does not have the same behaviour;
+    // just look at the usages of the two fields to see different treatment of 
the first as opposed to the second;
+    // implementations should probably use ConfigBag.getDeprecatedKey(...) to 
support both for a transition period.
+    // in addition, remove the settings of this key in 
DefaultConnectivityResolverTest and observe tests timeout forever
+    // (see the commit where this comment is introduced to fix tests in that 
class which attempted to migrate) 
+    // /** @deprecated since 0.11.0 use {@link 
#POLL_FOR_FIRST_REACHABLE_ADDRESS} instead. */
+    // @Deprecated
     ConfigKey<String> WAIT_FOR_SSHABLE = 
ConfigKeys.newStringConfigKey("waitForSshable",
             "Whether and how long to wait for a newly provisioned VM to be 
accessible via ssh; " +
             "if 'false', won't check; if 'true' uses default duration; 
otherwise accepts a time string e.g. '5m' (the default) or a number of 
milliseconds", "5m");
 
-    /** @deprecated since 0.11.0 use {@link #POLL_FOR_FIRST_REACHABLE_ADDRESS} 
instead. */
-    @Deprecated
+    // FIXME as WAIT_FOR_SSHABLE above
+    // /** @deprecated since 0.11.0 use {@link 
#POLL_FOR_FIRST_REACHABLE_ADDRESS} instead. */
+    // @Deprecated
     ConfigKey<String> WAIT_FOR_WINRM_AVAILABLE = 
ConfigKeys.newStringConfigKey("waitForWinRmAvailable",
             "Whether and how long to wait for a newly provisioned VM to be 
accessible via WinRm; " +
             "if 'false', won't check; if 'true' uses default duration; 
otherwise accepts a time string e.g. '30m' (the default) or a number of 
milliseconds", "30m");

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ce061afc/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/DefaultConnectivityResolverTest.java
----------------------------------------------------------------------
diff --git 
a/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/DefaultConnectivityResolverTest.java
 
b/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/DefaultConnectivityResolverTest.java
index 8b1bc5b..6088c54 100644
--- 
a/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/DefaultConnectivityResolverTest.java
+++ 
b/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/DefaultConnectivityResolverTest.java
@@ -92,6 +92,7 @@ public class DefaultConnectivityResolverTest extends 
AbstractJcloudsStubbedUnitT
         initNodeCreatorAndJcloudsLocation(newNodeCreator(), ImmutableMap.of());
         DefaultConnectivityResolver customizer = new 
DefaultConnectivityResolver();
         final ConfigBag config = ConfigBag.newInstance(ImmutableMap.of(
+                JcloudsLocationConfig.WAIT_FOR_SSHABLE, "1ms",
                 JcloudsLocationConfig.POLL_FOR_FIRST_REACHABLE_ADDRESS, 
"1ms"));
         assertTrue(customizer.checkCredential(
                 jcloudsLocation, HostAndPort.fromParts("10.0.0.234", 22),
@@ -114,6 +115,7 @@ public class DefaultConnectivityResolverTest extends 
AbstractJcloudsStubbedUnitT
         initNodeCreatorAndJcloudsLocation(newNodeCreator(), ImmutableMap.of());
         DefaultConnectivityResolver customizer = new 
DefaultConnectivityResolver();
         final ConfigBag config = ConfigBag.newInstance(ImmutableMap.of(
+                JcloudsLocationConfig.WAIT_FOR_WINRM_AVAILABLE, "1ms",
                 JcloudsLocationConfig.POLL_FOR_FIRST_REACHABLE_ADDRESS, 
"1ms"));
         assertTrue(customizer.checkCredential(
                 jcloudsLocation, HostAndPort.fromParts("10.0.0.234", 22),
@@ -146,6 +148,7 @@ public class DefaultConnectivityResolverTest extends 
AbstractJcloudsStubbedUnitT
         });
         ConfigBag config = ConfigBag.newInstance(ImmutableMap.of(
                 JcloudsLocationConfig.LOOKUP_AWS_HOSTNAME, false,
+                JcloudsLocationConfig.WAIT_FOR_SSHABLE, "1ms",
                 JcloudsLocationConfig.POLL_FOR_FIRST_REACHABLE_ADDRESS, "1ms",
                 JcloudsLocation.CUSTOM_CREDENTIALS, credential));
         ConnectivityResolverOptions options = 
newResolveOptionsForIps(reachableIps).build();

Reply via email to