don't assume servers to add is a singleton
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/47d01d71 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/47d01d71 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/47d01d71 Branch: refs/heads/master Commit: 47d01d719192e47ee4495431aad83dc94158387f Parents: d26acd8 Author: Alex Heneveld <[email protected]> Authored: Sat Feb 21 09:10:13 2015 -0800 Committer: Alex Heneveld <[email protected]> Committed: Sat Feb 21 09:10:13 2015 -0800 ---------------------------------------------------------------------- .../brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/47d01d71/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java ---------------------------------------------------------------------- diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java b/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java index 0eb2586..8d26896 100644 --- a/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java +++ b/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java @@ -233,8 +233,8 @@ public class CouchbaseClusterImpl extends DynamicClusterImpl implements Couchbas if (getQuorumSize()>1) { log.warn(this+" is not quorate; will likely fail later, but proceeding for now"); } - if (!serversToAdd.isEmpty()) { - ((EntityInternal) Iterables.getOnlyElement(serversToAdd)).setAttribute(CouchbaseNode.IS_IN_CLUSTER, true); + for (Entity server: serversToAdd) { + ((EntityInternal) server).setAttribute(CouchbaseNode.IS_IN_CLUSTER, true); } }
