Updated Branches:
  refs/heads/master a0a480fbb -> 6f3d930f9

setting lb cartridge type when subscribing to LB


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/6f3d930f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/6f3d930f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/6f3d930f

Branch: refs/heads/master
Commit: 6f3d930f9d21e52579737534d79633a5f1cbabbe
Parents: a0a480f
Author: Nirmal Fernando <[email protected]>
Authored: Sat Dec 14 16:59:28 2013 +0530
Committer: Nirmal Fernando <[email protected]>
Committed: Sat Dec 14 16:59:28 2013 +0530

----------------------------------------------------------------------
 .../stratos/rest/endpoint/services/ServiceUtils.java     | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6f3d930f/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
 
b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
index d206906..338a346 100644
--- 
a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
+++ 
b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
@@ -658,9 +658,10 @@ public class ServiceUtils {
             } else {
 
                 CartridgeInfo lbCartridgeInfo;
+                String lbCartridgeType = lbConfig.getType();
                 try {
                     // retrieve lb Cartridge info
-                    lbCartridgeInfo = 
cloudControllerServiceClient.getCartridgeInfo(lbConfig.getType());
+                    lbCartridgeInfo = 
cloudControllerServiceClient.getCartridgeInfo(lbCartridgeType);
                 } catch (Exception e) {
                     String msg = "Cannot get cartridge info: " + cartridgeType;
                     log.error(msg, e);
@@ -724,7 +725,7 @@ public class ServiceUtils {
                                 try {
                                     // get the valid policies for lb cartridge
                                     DeploymentPolicy[] lbCartridgeDepPolicies =
-                                                                               
 autoscalerServiceClient.getDeploymentPolicies(lbConfig.getType());
+                                                                               
 autoscalerServiceClient.getDeploymentPolicies(lbCartridgeType);
                                     // traverse deployment policies of lb 
cartridge
                                     for (DeploymentPolicy policy : 
lbCartridgeDepPolicies) {
                                         // check existence of the subscribed 
policy
@@ -734,7 +735,7 @@ public class ServiceUtils {
 
                                                 // if lb cluster doesn't exist
                                                 String lbAlias = "lb" + new 
Random().nextInt();
-                                                subscribeToLb(cartridgeType,
+                                                subscribeToLb(lbCartridgeType,
                                                           lbAlias,
                                                           
lbCartridgeInfo.getDefaultAutoscalingPolicy(),
                                                           deploymentPolicy, 
configurationContext,
@@ -763,7 +764,7 @@ public class ServiceUtils {
                                         
                                         // get the valid policies for lb 
cartridge
                                         DeploymentPolicy[] 
lbCartridgeDepPolicies =
-                                                                               
     autoscalerServiceClient.getDeploymentPolicies(lbConfig.getType());
+                                                                               
     autoscalerServiceClient.getDeploymentPolicies(lbCartridgeType);
                                         // traverse deployment policies of lb 
cartridge
                                         for (DeploymentPolicy policy : 
lbCartridgeDepPolicies) {
                                             // check existence of the 
subscribed policy
@@ -773,7 +774,7 @@ public class ServiceUtils {
 
                                                     // if lb cluster doesn't 
exist
                                                     String lbAlias = "lb" + 
cartridgeType + new Random().nextInt();
-                                                    
subscribeToLb(cartridgeType,
+                                                    
subscribeToLb(lbCartridgeType,
                                                               lbAlias,
                                                               
lbCartridgeInfo.getDefaultAutoscalingPolicy(),
                                                               
deploymentPolicy, configurationContext,

Reply via email to