You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2019/12/20 17:12:22 UTC

[brooklyn-server] branch master updated (482da12 -> 43c8b11)

This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git.


    from 482da12  This closes #1078
     new c7af4b2  add check for missing endpoint
     new e8f40f1  changes in response to code review
     new 43c8b11  This closes #1080

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../brooklyn/location/jclouds/AbstractComputeServiceRegistry.java    | 5 +++++
 1 file changed, 5 insertions(+)


[brooklyn-server] 02/03: changes in response to code review

Posted by he...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit e8f40f1844f80bdb6e8c6ece401c30a38aaa5f7f
Author: frogfather <j....@icloud.com>
AuthorDate: Fri Dec 20 16:54:14 2019 +0000

    changes in response to code review
---
 .../brooklyn/location/jclouds/AbstractComputeServiceRegistry.java      | 2 +-
 .../java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java     | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/AbstractComputeServiceRegistry.java b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/AbstractComputeServiceRegistry.java
index 1520df3..8e4c423 100644
--- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/AbstractComputeServiceRegistry.java
+++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/AbstractComputeServiceRegistry.java
@@ -57,7 +57,7 @@ public abstract class AbstractComputeServiceRegistry implements ComputeServiceRe
     private final Map<Map<?, ?>, ComputeService> cachedComputeServices = new ConcurrentHashMap<>();
 
     @Override
-    public ComputeService findComputeService(ConfigBag conf, boolean allowReuse) throws IllegalArgumentException {
+    public ComputeService findComputeService(ConfigBag conf, boolean allowReuse) {
         JCloudsPropertiesBuilder propertiesBuilder = new JCloudsPropertiesBuilder(conf)
                 .setCommonJcloudsProperties();
 
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 c6940a8..8d9a889 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
@@ -612,9 +612,6 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
         for (int i = 1; i <= attempts; i++) {
             try {
                 return obtainOnce(setup);
-            } catch (IllegalArgumentException e) {
-                LOG.warn("Attempt #{}/{} to obtain machine threw error: {}", new Object[]{i, attempts, e});
-                exceptions.add(e);
             } catch (RuntimeException e) {
                 LOG.warn("Attempt #{}/{} to obtain machine threw error: {}", new Object[]{i, attempts, e});
                 exceptions.add(e);


[brooklyn-server] 03/03: This closes #1080

Posted by he...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 43c8b11667f4d3336aa51678ce83287ae86baf7f
Merge: 482da12 e8f40f1
Author: Alex Heneveld <al...@cloudsoftcorp.com>
AuthorDate: Fri Dec 20 17:12:14 2019 +0000

    This closes #1080

 .../brooklyn/location/jclouds/AbstractComputeServiceRegistry.java    | 5 +++++
 1 file changed, 5 insertions(+)


[brooklyn-server] 01/03: add check for missing endpoint

Posted by he...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit c7af4b27026f863b1c807473e926301eeff0f91d
Author: frogfather <j....@icloud.com>
AuthorDate: Thu Dec 19 15:17:32 2019 +0000

    add check for missing endpoint
---
 .../brooklyn/location/jclouds/AbstractComputeServiceRegistry.java  | 7 ++++++-
 .../java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java | 3 +++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/AbstractComputeServiceRegistry.java b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/AbstractComputeServiceRegistry.java
index b9274f4..1520df3 100644
--- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/AbstractComputeServiceRegistry.java
+++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/AbstractComputeServiceRegistry.java
@@ -57,7 +57,7 @@ public abstract class AbstractComputeServiceRegistry implements ComputeServiceRe
     private final Map<Map<?, ?>, ComputeService> cachedComputeServices = new ConcurrentHashMap<>();
 
     @Override
-    public ComputeService findComputeService(ConfigBag conf, boolean allowReuse) {
+    public ComputeService findComputeService(ConfigBag conf, boolean allowReuse) throws IllegalArgumentException {
         JCloudsPropertiesBuilder propertiesBuilder = new JCloudsPropertiesBuilder(conf)
                 .setCommonJcloudsProperties();
 
@@ -82,6 +82,11 @@ public abstract class AbstractComputeServiceRegistry implements ComputeServiceRe
 
         Iterable<? extends Module> modules = modulesBuilder.build();
 
+        //Check for missing endpoint when provider is azure
+        if (properties.getProperty(Constants.PROPERTY_ENDPOINT) == null && ("azurecompute-arm".equals(provider))) {
+            throw new IllegalArgumentException("Endpoint property cannot be null when provider is azure-arm");
+        }
+
         Supplier<ComputeService> computeServiceSupplier = new ComputeServiceSupplier(conf, modules, properties);
         if (allowReuse) {
             return cachedComputeServices.computeIfAbsent(makeCacheKey(conf, properties), key -> computeServiceSupplier.get());
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 8d9a889..c6940a8 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
@@ -612,6 +612,9 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
         for (int i = 1; i <= attempts; i++) {
             try {
                 return obtainOnce(setup);
+            } catch (IllegalArgumentException e) {
+                LOG.warn("Attempt #{}/{} to obtain machine threw error: {}", new Object[]{i, attempts, e});
+                exceptions.add(e);
             } catch (RuntimeException e) {
                 LOG.warn("Attempt #{}/{} to obtain machine threw error: {}", new Object[]{i, attempts, e});
                 exceptions.add(e);