CLOUDSTACK-2461: createGSLBRule API is failing to pick the default algorithm 
"round
robin" for parameter "gslblbmethod"

fix defaults to round robin when parameter not specified


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3c51c4e7
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3c51c4e7
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3c51c4e7

Branch: refs/heads/vmware-datamodel
Commit: 3c51c4e7adb717b5cee3bd01be716d75e288aa0c
Parents: 6ae6c2b
Author: Murali Reddy <muralimmre...@gmail.com>
Authored: Thu May 16 12:26:23 2013 +0530
Committer: Murali Reddy <muralimmre...@gmail.com>
Committed: Thu May 16 15:19:40 2013 +0530

----------------------------------------------------------------------
 .../ha/gslb/CreateGlobalLoadBalancerRuleCmd.java   |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3c51c4e7/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
 
b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
index b08b6ae..07d3274 100644
--- 
a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
@@ -85,7 +85,11 @@ public class CreateGlobalLoadBalancerRuleCmd extends 
BaseAsyncCreateCmd {
     }
 
     public String getAlgorithm() {
-        return algorithm;
+        if (algorithm != null) {
+            return algorithm;
+        } else {
+            return GlobalLoadBalancerRule.Algorithm.RoundRobin.name();
+        }
     }
 
     public String getGslbMethod() {

Reply via email to