Repository: brooklyn-server
Updated Branches:
  refs/heads/master d69fda26e -> 215c02cb5


Log instead of exception on SshCommandMembershipTrackingPolicy waiting for 
machine


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

Branch: refs/heads/master
Commit: 215c02cb53717fee35d3b7f6b3e1f3d902fcb351
Parents: d69fda2
Author: Andrew Donald Kennedy <[email protected]>
Authored: Thu Aug 11 23:44:26 2016 +0100
Committer: Andrew Donald Kennedy <[email protected]>
Committed: Thu Aug 11 23:44:35 2016 +0100

----------------------------------------------------------------------
 .../entity/group/SshCommandMembershipTrackingPolicy.java        | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/215c02cb/core/src/main/java/org/apache/brooklyn/entity/group/SshCommandMembershipTrackingPolicy.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/brooklyn/entity/group/SshCommandMembershipTrackingPolicy.java
 
b/core/src/main/java/org/apache/brooklyn/entity/group/SshCommandMembershipTrackingPolicy.java
index bf899ba..e7dffb5 100644
--- 
a/core/src/main/java/org/apache/brooklyn/entity/group/SshCommandMembershipTrackingPolicy.java
+++ 
b/core/src/main/java/org/apache/brooklyn/entity/group/SshCommandMembershipTrackingPolicy.java
@@ -86,7 +86,8 @@ public class SshCommandMembershipTrackingPolicy extends 
AbstractMembershipTracki
         Collection<? extends Location> locations = 
Locations.getLocationsCheckingAncestors(entity.getLocations(), entity);
         Maybe<SshMachineLocation> machine = 
Machines.findUniqueMachineLocation(locations, SshMachineLocation.class);
         if (machine.isAbsentOrNull()) {
-            throw new IllegalStateException("No machine available to execute 
command");
+            LOG.debug("No machine available to execute command");
+            return;
         }
         LOG.info("Executing command on {}: {}", machine.get(), command);
         String executionDir = config().get(EXECUTION_DIR);
@@ -117,6 +118,6 @@ public class SshCommandMembershipTrackingPolicy extends 
AbstractMembershipTracki
                 .environmentVariables(serializer.serialize(env));
 
         String output = DynamicTasks.submit(task.newTask(), 
entity).getUnchecked();
-        LOG.debug("Command returned: {}", output);
+        LOG.trace("Command returned: {}", output);
     }
 }

Reply via email to