Fixes broken cluster location logic

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

Branch: refs/heads/master
Commit: 96f2f1c2ef5c6ece333ece8879ca6e992da5024c
Parents: d205bb5
Author: Martin Harris <[email protected]>
Authored: Wed May 6 14:18:13 2015 +0100
Committer: Richard Downer <[email protected]>
Committed: Thu May 28 17:27:35 2015 +0100

----------------------------------------------------------------------
 core/src/main/java/brooklyn/entity/group/DynamicClusterImpl.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/96f2f1c2/core/src/main/java/brooklyn/entity/group/DynamicClusterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/group/DynamicClusterImpl.java 
b/core/src/main/java/brooklyn/entity/group/DynamicClusterImpl.java
index 7d82e2e..5c168aa 100644
--- a/core/src/main/java/brooklyn/entity/group/DynamicClusterImpl.java
+++ b/core/src/main/java/brooklyn/entity/group/DynamicClusterImpl.java
@@ -588,8 +588,8 @@ public class DynamicClusterImpl extends AbstractGroupImpl 
implements DynamicClus
 
         // choose locations to be deployed to
         List<Location> chosenLocations;
-        chosenLocations = getMemberSpec().getLocations();
-        if (chosenLocations == null) {
+        chosenLocations = getMemberSpec() == null ? null : 
getMemberSpec().getLocations();
+        if (chosenLocations == null || chosenLocations.size() == 0) {
             if (isAvailabilityZoneEnabled()) {
                 List<Location> subLocations = getNonFailedSubLocations();
                 Multimap<Location, Entity> membersByLocation = 
getMembersByLocation();

Reply via email to