cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tall...@apache.org
Subject [51/60] [abbrv] git commit: updated refs/heads/marvin to 0e223d6
Date Tue, 08 Apr 2014 12:26:06 GMT
CLOUDSTACK-6327 updated uuid to id mapping


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

Branch: refs/heads/marvin
Commit: 78a29c0d4110d2c4560c1b7a74213d983de6193c
Parents: cc2892c
Author: Jayapal <jayapal@apache.org>
Authored: Mon Apr 7 15:57:00 2014 +0530
Committer: Jayapal <jayapal@apache.org>
Committed: Mon Apr 7 18:03:57 2014 +0530

----------------------------------------------------------------------
 .../user/loadbalancer/AssignToLoadBalancerRuleCmd.java       | 7 ++++++-
 .../user/loadbalancer/RemoveFromLoadBalancerRuleCmd.java     | 8 +++++++-
 .../com/cloud/network/lb/LoadBalancingRulesManagerImpl.java  | 2 +-
 3 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/78a29c0d/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
index eb26ce6..a519993 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
@@ -137,7 +137,12 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd {
                 String vmId = idIpsMap.get("vmid");
                 String vmIp = idIpsMap.get("vmip");
 
-                Long longVmId = new Long(vmId);
+                VirtualMachine lbvm = _entityMgr.findByUuid(VirtualMachine.class, vmId);
+                if (lbvm == null) {
+                    throw new InvalidParameterValueException("Unable to find virtual machine
ID: " + vmId);
+                }
+
+                Long longVmId = lbvm.getId();
 
                 List<String> ipsList = null;
                 if (vmIdIpsMap.containsKey(longVmId)) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/78a29c0d/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveFromLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveFromLoadBalancerRuleCmd.java
b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveFromLoadBalancerRuleCmd.java
index b3eb159..1376556 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveFromLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveFromLoadBalancerRuleCmd.java
@@ -23,6 +23,7 @@ import java.util.Collection;
 import java.util.Iterator;
 import java.util.ArrayList;
 
+import com.cloud.vm.VirtualMachine;
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
@@ -126,7 +127,12 @@ public class RemoveFromLoadBalancerRuleCmd extends BaseAsyncCmd {
                 String vmId = idIpsMap.get("vmid");
                 String vmIp = idIpsMap.get("vmip");
 
-                Long longVmId = new Long(vmId);
+                VirtualMachine lbvm = _entityMgr.findByUuid(VirtualMachine.class, vmId);
+                if (lbvm == null) {
+                    throw new InvalidParameterValueException("Unable to find virtual machine
ID: " + vmId);
+                }
+
+                Long longVmId = lbvm.getId();
 
                 List<String> ipsList = null;
                 if (vmIdIpsMap.containsKey(longVmId)) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/78a29c0d/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
index 51c36b6..db2817f 100755
--- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
+++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
@@ -1382,7 +1382,7 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase
implements
             s_logger.warn("Unable to apply the load balancer config because resource is unavaliable.",
e);
         }
         if (!success) {
-            CloudRuntimeException ex = new CloudRuntimeException("Failed to remove specified
load balancer rule id for vms " + instanceIds);
+            CloudRuntimeException ex = new CloudRuntimeException("Failed to remove specified
load balancer rule id for vms " + vmIds);
             ex.addProxyObject(loadBalancer.getUuid(), "loadBalancerId");
             throw ex;
         }


Mime
View raw message