brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [1/2] brooklyn-server git commit: Fix for BROOKLYN-314
Date Tue, 19 Jul 2016 19:00:32 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/master 8f9d73ef6 -> aad12a62c


Fix for BROOKLYN-314

Try-catch in getOptionalNode/getOptionalImage (e.g. if called by user
in rebind code, then don’t fail outright if cloud throws exception

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

Branch: refs/heads/master
Commit: 1f1e7c7696c63476880d38a12d6bffbcc8cfb05e
Parents: 8f9d73e
Author: Aled Sage <aled.sage@gmail.com>
Authored: Tue Jul 19 16:16:36 2016 +0100
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Tue Jul 19 16:16:36 2016 +0100

----------------------------------------------------------------------
 .../location/jclouds/JcloudsSshMachineLocation.java | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/1f1e7c76/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsSshMachineLocation.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsSshMachineLocation.java
b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsSshMachineLocation.java
index 67af0e7..6d3553b 100644
--- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsSshMachineLocation.java
+++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsSshMachineLocation.java
@@ -221,7 +221,13 @@ public class JcloudsSshMachineLocation extends SshMachineLocation implements
Jcl
     @Override
     public Optional<NodeMetadata> getOptionalNode() {
       if (_node == null) {
-          _node = Optional.fromNullable(getParent().getComputeService().getNodeMetadata(nodeId));
+          try {
+              _node = Optional.fromNullable(getParent().getComputeService().getNodeMetadata(nodeId));
+          } catch (Exception e) {
+              Exceptions.propagateIfFatal(e);
+              if (LOG.isDebugEnabled()) LOG.debug("Problem getting node-metadata for " +
this + ", node id " + nodeId + " (continuing)", e);
+              _node = Optional.absent();
+          }
       }
       return _node;
     }
@@ -231,7 +237,13 @@ public class JcloudsSshMachineLocation extends SshMachineLocation implements
Jcl
           if (imageId == null) {
               _image = Optional.absent(); // can happen with JcloudsLocation.resumeMachine()
usage
           } else {
-              _image = Optional.fromNullable(getParent().getComputeService().getImage(imageId));
+              try {
+                  _image = Optional.fromNullable(getParent().getComputeService().getImage(imageId));
+              } catch (Exception e) {
+                  Exceptions.propagateIfFatal(e);
+                  if (LOG.isDebugEnabled()) LOG.debug("Problem getting image for " + this
+ ", image id " + imageId + " (continuing)", e);
+                  _image = Optional.absent();
+              }
           }
       }
       return _image;


Mime
View raw message