cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tall...@apache.org
Subject [53/60] [abbrv] git commit: updated refs/heads/marvin to 0e223d6
Date Tue, 08 Apr 2014 12:26:08 GMT
CLOUDSTACK-6353 Fixed listing vm ip details for lb rule


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

Branch: refs/heads/marvin
Commit: e6e4fe4d2695c2f3b1a93a577341bd8b0d325013
Parents: e8227c8
Author: Jayapal <jayapal@apache.org>
Authored: Tue Apr 8 12:53:28 2014 +0530
Committer: Jayapal <jayapal@apache.org>
Committed: Tue Apr 8 12:56:02 2014 +0530

----------------------------------------------------------------------
 .../loadbalancer/ListLoadBalancerRuleInstancesCmdByAdmin.java   | 5 ++++-
 .../src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java | 5 +++++
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e6e4fe4d/api/src/org/apache/cloudstack/api/command/admin/loadbalancer/ListLoadBalancerRuleInstancesCmdByAdmin.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/loadbalancer/ListLoadBalancerRuleInstancesCmdByAdmin.java
b/api/src/org/apache/cloudstack/api/command/admin/loadbalancer/ListLoadBalancerRuleInstancesCmdByAdmin.java
index 0e8c377..6c0d8a4 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/loadbalancer/ListLoadBalancerRuleInstancesCmdByAdmin.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/loadbalancer/ListLoadBalancerRuleInstancesCmdByAdmin.java
@@ -19,6 +19,7 @@ package org.apache.cloudstack.api.command.admin.loadbalancer;
 import java.util.ArrayList;
 import java.util.List;
 
+import com.cloud.vm.VirtualMachine;
 import org.apache.cloudstack.api.response.LoadBalancerRuleVmMapResponse;
 import org.apache.log4j.Logger;
 
@@ -75,7 +76,9 @@ public class ListLoadBalancerRuleInstancesCmdByAdmin extends ListLoadBalancerRul
                     LoadBalancerRuleVmMapResponse lbRuleVmIpResponse = new LoadBalancerRuleVmMapResponse();
                     vmResponses.get(i).setServiceState(serviceStates.get(i));
                     lbRuleVmIpResponse.setUserVmResponse(vmResponses.get(i));
-                    lbRuleVmIpResponse.setIpAddr(_lbService.listLbVmIpAddress(getId(), result.get(i).getId()));
+                    //get vm id from the uuid
+                    VirtualMachine lbvm = _entityMgr.findByUuid(VirtualMachine.class, vmResponses.get(i).getId());
+                    lbRuleVmIpResponse.setIpAddr(_lbService.listLbVmIpAddress(getId(), lbvm.getId()));
                     lbRuleVmIpResponse.setObjectName("lbrulevmidip");
                     listlbVmRes.add(lbRuleVmIpResponse);
                 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e6e4fe4d/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 db2817f..63912b3 100755
--- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
+++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
@@ -1044,6 +1044,11 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase
implements
                 vmIpsList.add(priIp);
                 vmIdIpMap.put(instanceId, vmIpsList);
             } else {
+                // skip the primary ip from vm secondary ip comparisions
+                if (vmIpsList.contains(priIp)) {
+                    vmIpsList.remove(priIp);
+                }
+
                 //check if the ips belongs to nic secondary ip
                 for (String ip: vmIpsList) {
                     if(_nicSecondaryIpDao.findByIp4AddressAndNicId(ip,nicInSameNetwork.getId())
== null) {


Mime
View raw message