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

[1/5] incubator-brooklyn git commit: Rabbit launch: wait 30 secs rather than 10s

Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master cb57de4bb -> 5809a0720


Rabbit launch: wait 30 secs rather than 10s

I saw a timeout failure for launch when provisioning to Azure.
The console output showed it was eventually successful though. So
increasing how long we wait for “broker running”.

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

Branch: refs/heads/master
Commit: 1cf3ebf05e7dc6e4c8b20c6116480257f2326083
Parents: cb57de4
Author: Aled Sage <al...@gmail.com>
Authored: Thu Dec 3 12:47:47 2015 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Dec 3 12:47:47 2015 +0000

----------------------------------------------------------------------
 .../apache/brooklyn/entity/messaging/rabbit/RabbitSshDriver.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/1cf3ebf0/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/rabbit/RabbitSshDriver.java
----------------------------------------------------------------------
diff --git a/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/rabbit/RabbitSshDriver.java b/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/rabbit/RabbitSshDriver.java
index 950c6ad..c8d0a89 100644
--- a/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/rabbit/RabbitSshDriver.java
+++ b/software/messaging/src/main/java/org/apache/brooklyn/entity/messaging/rabbit/RabbitSshDriver.java
@@ -147,7 +147,7 @@ public class RabbitSshDriver extends AbstractSoftwareProcessSshDriver implements
         newScript(MutableMap.of("usePidFile", false), LAUNCHING)
             .body.append(
                 "nohup ./sbin/rabbitmq-server > console-out.log 2> console-err.log &",
-                "for i in {1..10}\n" +
+                "for i in {1..30}\n" +
                     "do\n" +
                      "    grep 'broker running' console-out.log && exit\n" +
                      "    sleep 1\n" +


[3/5] incubator-brooklyn git commit: Adds JcloudsLocation.pollForFirstReachableAddress

Posted by al...@apache.org.
Adds JcloudsLocation.pollForFirstReachableAddress

Whether to try to reach each address (to find one that is responding),
and if so for how long. Alternatively, if “false” then it will just
take the first address.


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

Branch: refs/heads/master
Commit: 1c63b719663dad374f106956542063e8565412f5
Parents: 11689ea
Author: Aled Sage <al...@gmail.com>
Authored: Thu Dec 3 16:59:30 2015 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Dec 3 16:59:30 2015 +0000

----------------------------------------------------------------------
 .../location/cloud/CloudLocationConfig.java     |  5 +++
 .../location/jclouds/JcloudsLocation.java       | 37 +++++++++++++++-----
 2 files changed, 33 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/1c63b719/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 37989f0..f749f64 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
@@ -69,6 +69,11 @@ public interface CloudLocationConfig {
         "vmNameSaltLength", "Number of characters to use for a random identifier inserted in hostname "
             + "to uniquely identify machines", 4);
 
+    public static final ConfigKey<String> POLL_FOR_FIRST_REACHABLE_ADDRESS = ConfigKeys.newStringConfigKey("pollForFirstReachableAddress", 
+            "Whether and how long to wait for reaching the VM's ip:port; "
+            + "if 'false', will default to the node's first public IP (or privae if no public IPs); "
+            + "if 'true' uses default duration; otherwise accepts a time string e.g. '5m' (the default) or a number of milliseconds", "5m");
+
     public static final 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");

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/1c63b719/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 5afc3b3..5e7639c 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
@@ -1608,6 +1608,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
         }
     }
 
+    
     /**
      * Create the user immediately - executing ssh commands as required.
      */
@@ -1638,7 +1639,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
                 }
 
                 String initialUser = initialCredentials.getUser();
-                String address = hostAndPortOverride.isPresent() ? hostAndPortOverride.get().getHostText() : JcloudsUtil.getFirstReachableAddress(computeService.getContext(), node);
+                String address = hostAndPortOverride.isPresent() ? hostAndPortOverride.get().getHostText() : getFirstReachableAddress(node, config);
                 int port = hostAndPortOverride.isPresent() ? hostAndPortOverride.get().getPort() : node.getLoginPort();
                 
                 // TODO Retrying lots of times as workaround for vcloud-director. There the guest customizations
@@ -2161,7 +2162,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
             LOG.debug("Could not resolve reported address '"+address+"' for "+vmHostname+" ("+setup.getDescription()+"/"+node+"), requesting reachable address");
             if (computeService==null) throw Exceptions.propagate(e);
             // this has sometimes already been done in waitForReachable (unless skipped) but easy enough to do again
-            address = JcloudsUtil.getFirstReachableAddress(computeService.getContext(), node);
+            address = getFirstReachableAddress(node, setup);
         }
 
         if (LOG.isDebugEnabled())
@@ -2498,6 +2499,25 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
         return null;
     }
 
+    protected String getFirstReachableAddress(NodeMetadata node, ConfigBag setup) {
+        String pollForFirstReachable = setup.get(POLL_FOR_FIRST_REACHABLE_ADDRESS);
+        
+        boolean enabled = !"false".equalsIgnoreCase(pollForFirstReachable);
+        String result;
+        if (enabled) {
+            Duration timeout = "true".equals(pollForFirstReachable) ? Duration.FIVE_MINUTES : Duration.of(pollForFirstReachable); 
+            result = JcloudsUtil.getFirstReachableAddress(node, timeout);
+            LOG.debug("Using first-reachable address "+result+" for node "+node+" in "+this);
+        } else {
+            result = Iterables.getFirst(Iterables.concat(node.getPublicAddresses(), node.getPrivateAddresses()), null);
+            if (result == null) {
+                throw new IllegalStateException("No addresses available for node "+node+" in "+this);
+            }
+            LOG.debug("Using first address "+result+" for node "+node+" in "+this);
+        }
+        return result;
+    }
+
     protected LoginCredentials waitForWinRmAvailable(final ComputeService computeService, final NodeMetadata node, Optional<HostAndPort> hostAndPortOverride, ConfigBag setup) {
         return waitForWinRmAvailable(computeService, node, hostAndPortOverride, node.getCredentials(), setup);
     }
@@ -2524,9 +2544,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
                 : 5985; // WinRM port
         String vmIp = hostAndPortOverride.isPresent() 
                 ? hostAndPortOverride.get().getHostText() 
-                : JcloudsUtil.getFirstReachableAddress(
-                        computeService.getContext(), 
-                        NodeMetadataBuilder.fromNodeMetadata(node).loginPort(vmPort).build());
+                : getFirstReachableAddress(NodeMetadataBuilder.fromNodeMetadata(node).loginPort(vmPort).build(), setup);
 
         final Session session = WinRMFactory.INSTANCE.createSession(vmIp+":"+vmPort, user, password);
 
@@ -2593,7 +2611,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
             users.add(creds.getUser());
         }
         String user = (users.size() == 1) ? Iterables.getOnlyElement(users) : "{" + Joiner.on(",").join(users) + "}";
-        String vmIp = hostAndPortOverride.isPresent() ? hostAndPortOverride.get().getHostText() : JcloudsUtil.getFirstReachableAddress(computeService.getContext(), node);
+        String vmIp = hostAndPortOverride.isPresent() ? hostAndPortOverride.get().getHostText() : getFirstReachableAddress(node, setup);
         if (vmIp==null) LOG.warn("Unable to extract IP for "+node+" ("+setup.getDescription()+"): subsequent connection attempt will likely fail");
         int vmPort = hostAndPortOverride.isPresent() ? hostAndPortOverride.get().getPortOrDefault(22) : 22;
 
@@ -2760,7 +2778,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
             HostAndPort inferredHostAndPort = null;
             if (!sshHostAndPort.isPresent()) {
                 try {
-                    String vmIp = JcloudsUtil.getFirstReachableAddress(this.getComputeService().getContext(), node);
+                    String vmIp = getFirstReachableAddress(node, setup);
                     int port = node.getLoginPort();
                     inferredHostAndPort = HostAndPort.fromParts(vmIp, port);
                 } catch (Exception e) {
@@ -2794,12 +2812,13 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
     }
 
     private String getPublicHostnameGeneric(NodeMetadata node, @Nullable ConfigBag setup) {
-        // JcloudsUtil.getFirstReachableAddress() already succeeded so at least one of the provided
+        // JcloudsUtil.getFirstReachableAddress() (probably) already succeeded so at least one of the provided
         // public and private IPs is reachable. Prefer the public IP. Don't use hostname as a fallback
         // from the public address - if public address is missing why would hostname resolve to a 
         // public IP? It is sometimes wrong/abbreviated, resolving to the wrong IP, also e.g. on
         // rackspace, the hostname lacks the domain.
         //
+        // TODO If POLL_FOR_FIRST_REACHABLE_ADDRESS=false, then won't have checked if any node is reachable.
         // TODO Some of the private addresses might not be reachable, should check connectivity before
         // making a choice.
         // TODO Choose an IP once and stick to it - multiple places call JcloudsUtil.getFirstReachableAddress(),
@@ -2868,7 +2887,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
         HostAndPort inferredHostAndPort = null;
         if (!sshHostAndPort.isPresent()) {
             try {
-                String vmIp = JcloudsUtil.getFirstReachableAddress(this.getComputeService().getContext(), node);
+                String vmIp = getFirstReachableAddress(node, setup);
                 int port = node.getLoginPort();
                 inferredHostAndPort = HostAndPort.fromParts(vmIp, port);
             } catch (Exception e) {


[2/5] incubator-brooklyn git commit: WinRM: improve logging in winrm4j integration

Posted by al...@apache.org.
WinRM: improve logging in winrm4j integration

Say how long it’s taken to connect/execute.
And say which user@host:port it executed against.


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

Branch: refs/heads/master
Commit: 11689ea1c1e9bb23e7428f00759cb401ecdedaaa
Parents: 1cf3ebf
Author: Aled Sage <al...@gmail.com>
Authored: Thu Dec 3 12:48:38 2015 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Dec 3 12:48:38 2015 +0000

----------------------------------------------------------------------
 .../internal/winrm/pywinrm/Winrm4jTool.java     | 64 ++++++++++++++++----
 1 file changed, 52 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/11689ea1/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/pywinrm/Winrm4jTool.java
----------------------------------------------------------------------
diff --git a/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/pywinrm/Winrm4jTool.java b/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/pywinrm/Winrm4jTool.java
index 9a4dfb9..57b0e2b 100644
--- a/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/pywinrm/Winrm4jTool.java
+++ b/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/pywinrm/Winrm4jTool.java
@@ -28,6 +28,7 @@ import java.util.Map;
 import java.util.concurrent.Callable;
 
 import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.ConfigKeys;
 import org.apache.brooklyn.core.config.Sanitizer;
 import org.apache.brooklyn.util.core.config.ConfigBag;
 import org.apache.brooklyn.util.exceptions.Exceptions;
@@ -38,9 +39,13 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.annotations.Beta;
+import com.google.common.base.Function;
+import com.google.common.base.Joiner;
+import com.google.common.base.Stopwatch;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
 
+import io.cloudsoft.winrm4j.winrm.WinRmTool;
 import io.cloudsoft.winrm4j.winrm.WinRmToolResponse;
 
 @Beta
@@ -48,6 +53,13 @@ public class Winrm4jTool implements org.apache.brooklyn.util.core.internal.winrm
 
     private static final Logger LOG = LoggerFactory.getLogger(Winrm4jTool.class);
 
+    // TODO Should we move this up to the interface?
+    @Beta
+    public static final ConfigKey<Boolean> LOG_CREDENTIALS = ConfigKeys.newBooleanConfigKey(
+            "logCredentials", 
+            "Whether to log the WinRM credentials used - strongly recommended never be used in production, as it is a big security hole!",
+            false);
+
     private final ConfigBag bag;
     private final String host;
     private final Integer port;
@@ -55,7 +67,8 @@ public class Winrm4jTool implements org.apache.brooklyn.util.core.internal.winrm
     private final String password;
     private final int execTries;
     private final Duration execRetryDelay;
-
+    private final boolean logCredentials;
+    
     public Winrm4jTool(Map<String,?> config) {
         this(ConfigBag.newInstance(config));
     }
@@ -68,22 +81,23 @@ public class Winrm4jTool implements org.apache.brooklyn.util.core.internal.winrm
         password = getRequiredConfig(config, PROP_PASSWORD);
         execTries = getRequiredConfig(config, PROP_EXEC_TRIES);
         execRetryDelay = getRequiredConfig(config, PROP_EXEC_RETRY_DELAY);
+        logCredentials = getRequiredConfig(config, LOG_CREDENTIALS);
     }
     
     @Override
     public org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse executeScript(final List<String> commands) {
-        return exec(new Callable<io.cloudsoft.winrm4j.winrm.WinRmToolResponse>() {
-            @Override public WinRmToolResponse call() throws Exception {
-                return connect().executeScript(commands);
+        return exec(new Function<io.cloudsoft.winrm4j.winrm.WinRmTool, io.cloudsoft.winrm4j.winrm.WinRmToolResponse>() {
+            @Override public WinRmToolResponse apply(io.cloudsoft.winrm4j.winrm.WinRmTool tool) {
+                return tool.executeScript(commands);
             }
         });
     }
 
     @Override
     public org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse executePs(final List<String> commands) {
-        return exec(new Callable<io.cloudsoft.winrm4j.winrm.WinRmToolResponse>() {
-            @Override public WinRmToolResponse call() throws Exception {
-                return connect().executePs(commands);
+        return exec(new Function<io.cloudsoft.winrm4j.winrm.WinRmTool, io.cloudsoft.winrm4j.winrm.WinRmToolResponse>() {
+            @Override public WinRmToolResponse apply(io.cloudsoft.winrm4j.winrm.WinRmTool tool) {
+                return tool.executePs(commands);
             }
         });
     }
@@ -115,21 +129,47 @@ public class Winrm4jTool implements org.apache.brooklyn.util.core.internal.winrm
         }
     }
 
-    private org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse exec(Callable<io.cloudsoft.winrm4j.winrm.WinRmToolResponse> task) {
+    private org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse exec(Function<io.cloudsoft.winrm4j.winrm.WinRmTool, io.cloudsoft.winrm4j.winrm.WinRmToolResponse> task) {
         Collection<Throwable> exceptions = Lists.newArrayList();
+        Stopwatch totalStopwatch = Stopwatch.createStarted();
+        
         for (int i = 0; i < execTries; i++) {
+            Stopwatch stopwatch = Stopwatch.createStarted();
+            Duration connectTimestamp = null;
+            Duration execTimestamp = null;
             try {
-                return wrap(task.call());
+                WinRmTool tool = connect();
+                connectTimestamp = Duration.of(stopwatch);
+                WinRmToolResponse result = task.apply(tool);
+                execTimestamp = Duration.of(stopwatch);
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Finished WinRM exec on "+user+"@"+host+":"+port+" "
+                            + (logCredentials ? "password=" + password : "")
+                            + " done after "+Duration.of(execTimestamp).toStringRounded()
+                            + " (connected in "+Duration.of(connectTimestamp).toStringRounded() + ")");
+                }
+                return wrap(result);
             } catch (Exception e) {
                 Exceptions.propagateIfFatal(e);
                 Duration sleep = Duration.millis(Math.min(Math.pow(2, i) * 1000, execRetryDelay.toMilliseconds()));
+                Duration failTimestamp = Duration.of(stopwatch);
+                String timeMsg = "total time "+Duration.of(totalStopwatch).toStringRounded()
+                        + ", this attempt failed after "+Duration.of(failTimestamp).toStringRounded()
+                        + (connectTimestamp != null ? ", connected in "+Duration.of(connectTimestamp).toStringRounded() : "");
+                
                 if (i == (execTries+1)) {
-                    LOG.info("Propagating WinRM exception (attempt "+(i+1)+" of "+execTries+")", e);
+                    LOG.info("Propagating exception - WinRM failed on "+user+"@"+host+":"+port+" "
+                            + (logCredentials ? "password=" + password : "")
+                            + "; (attempt "+(i+1)+" of "+execTries+"; "+timeMsg+")", e);
                 } else if (i == 0) {
-                    LOG.warn("Ignoring WinRM exception and will retry after "+sleep+" (attempt "+(i+1)+" of "+execTries+")", e);
+                    LOG.warn("Ignoring WinRM exception on "+user+"@"+host+":"+port+" "
+                            + (logCredentials ? "password=" + password : "")
+                            + " and will retry after "+sleep+" (attempt "+(i+1)+" of "+execTries+"; "+timeMsg+")", e);
                     Time.sleep(sleep);
                 } else {
-                    LOG.debug("Ignoring WinRM exception and will retry after "+sleep+" (attempt "+(i+1)+" of "+execTries+")", e);
+                    LOG.debug("Ignoring WinRM exception on "+user+"@"+host+":"+port+" "
+                            + (logCredentials ? "password=" + password : "")
+                            + " and will retry after "+sleep+" (attempt "+(i+1)+" of "+execTries+"; "+timeMsg+")", e);
                     Time.sleep(sleep);
                 }
                 exceptions.add(e);


[4/5] incubator-brooklyn git commit: populateServiceNotUpDiagnostics: clear when healthy

Posted by al...@apache.org.
populateServiceNotUpDiagnostics: clear when healthy

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

Branch: refs/heads/master
Commit: dafb5ecdfa3ff9326c14a40dbed37e8b556a8cf5
Parents: 1c63b71
Author: Aled Sage <al...@gmail.com>
Authored: Thu Dec 3 17:03:51 2015 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Dec 3 17:03:51 2015 +0000

----------------------------------------------------------------------
 .../entity/software/base/SoftwareProcessImpl.java   | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/dafb5ecd/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcessImpl.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcessImpl.java b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcessImpl.java
index 40c70b6..d3e6593 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcessImpl.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcessImpl.java
@@ -186,23 +186,33 @@ public abstract class SoftwareProcessImpl extends AbstractEntity implements Soft
     public void populateServiceNotUpDiagnostics() {
         if (getDriver() == null) {
             ServiceStateLogic.updateMapSensorEntry(this, ServiceStateLogic.SERVICE_NOT_UP_DIAGNOSTICS, "driver", "No driver");
+            ServiceStateLogic.clearMapSensorEntry(this, ServiceStateLogic.SERVICE_NOT_UP_DIAGNOSTICS, "sshable");
+            ServiceStateLogic.clearMapSensorEntry(this, ServiceStateLogic.SERVICE_NOT_UP_DIAGNOSTICS, SERVICE_PROCESS_IS_RUNNING.getName());
             return;
+        } else {
+            ServiceStateLogic.clearMapSensorEntry(this, ServiceStateLogic.SERVICE_NOT_UP_DIAGNOSTICS, "driver");
         }
 
         Location loc = getDriver().getLocation();
         if (loc instanceof SshMachineLocation) {
-            if (!((SshMachineLocation)loc).isSshable()) {
+            if (((SshMachineLocation)loc).isSshable()) {
+                ServiceStateLogic.clearMapSensorEntry(this, ServiceStateLogic.SERVICE_NOT_UP_DIAGNOSTICS, "sshable");
+            } else {
                 ServiceStateLogic.updateMapSensorEntry(
                         this, 
                         ServiceStateLogic.SERVICE_NOT_UP_DIAGNOSTICS, 
                         "sshable", 
                         "The machine for this entity does not appear to be sshable");
             }
-            return;
         }
 
         boolean processIsRunning = getDriver().isRunning();
-        if (!processIsRunning) {
+        if (processIsRunning) {
+            ServiceStateLogic.clearMapSensorEntry(
+                    this, 
+                    ServiceStateLogic.SERVICE_NOT_UP_DIAGNOSTICS, 
+                    SERVICE_PROCESS_IS_RUNNING.getName());
+        } else {
             ServiceStateLogic.updateMapSensorEntry(
                     this, 
                     ServiceStateLogic.SERVICE_NOT_UP_DIAGNOSTICS, 


[5/5] incubator-brooklyn git commit: This closes #1086

Posted by al...@apache.org.
This closes #1086


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

Branch: refs/heads/master
Commit: 5809a0720085ef4e49016516f3e99b1683db8154
Parents: cb57de4 dafb5ec
Author: Aled Sage <al...@gmail.com>
Authored: Thu Dec 3 19:09:50 2015 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Dec 3 19:09:50 2015 +0000

----------------------------------------------------------------------
 .../location/cloud/CloudLocationConfig.java     |  5 ++
 .../location/jclouds/JcloudsLocation.java       | 37 ++++++++---
 .../software/base/SoftwareProcessImpl.java      | 16 ++++-
 .../messaging/rabbit/RabbitSshDriver.java       |  2 +-
 .../internal/winrm/pywinrm/Winrm4jTool.java     | 64 ++++++++++++++++----
 5 files changed, 99 insertions(+), 25 deletions(-)
----------------------------------------------------------------------