You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ga...@apache.org on 2015/08/21 09:09:13 UTC
stratos git commit: Update the get cartridge group service method
Repository: stratos
Updated Branches:
refs/heads/tenant-isolation 861d6ac17 -> 02eafdf53
Update the get cartridge group service method
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/02eafdf5
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/02eafdf5
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/02eafdf5
Branch: refs/heads/tenant-isolation
Commit: 02eafdf534d4643db2e56a126d230a7d6fe9cb6a
Parents: 861d6ac
Author: gayangunarathne <ga...@wso2.com>
Authored: Fri Aug 21 12:38:56 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Fri Aug 21 12:38:56 2015 +0530
----------------------------------------------------------------------
.../services/impl/AutoscalerServiceImpl.java | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/02eafdf5/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
index e5fd50d..6c47116 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
@@ -907,12 +907,14 @@ public class AutoscalerServiceImpl implements AutoscalerService {
}
try {
ServiceGroup[] serviceGroups=getServiceGroupsByTenant(tenantId);
- for(ServiceGroup serviceGroup:serviceGroups){
- if(serviceGroup.getName().equals(name)){
- selectedGroup=serviceGroup;
- }
- else{
- ServiceGroup[] innerGroups=serviceGroup.getGroups();
+ for(ServiceGroup serviceGroup:serviceGroups) {
+ if (serviceGroup.getName().equals(name)) {
+ selectedGroup = serviceGroup;
+ return selectedGroup;
+ }
+ }
+ for(ServiceGroup serviceGroup:serviceGroups) {
+ ServiceGroup[] innerGroups=serviceGroup.getGroups();
while(innerGroups!=null){
for(ServiceGroup nestedGroup:innerGroups) {
if(nestedGroup.getName().equals(name)){
@@ -923,7 +925,6 @@ public class AutoscalerServiceImpl implements AutoscalerService {
}
}
}
- }
}
return selectedGroup;
} catch (Exception e) {