cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject git commit: updated refs/heads/master to 5437a0d
Date Fri, 28 Jun 2013 00:16:08 GMT
Updated Branches:
  refs/heads/master 4858bd1df -> 5437a0d05


CLOUDSTACK-3126: don't count system network (private gateway's network) when calculate networks
count in the vpc


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

Branch: refs/heads/master
Commit: 5437a0d0587f6e8492da66587c1ae165015f0d39
Parents: 4858bd1
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Thu Jun 27 17:09:13 2013 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Thu Jun 27 17:10:14 2013 -0700

----------------------------------------------------------------------
 engine/schema/src/com/cloud/network/dao/NetworkDaoImpl.java | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5437a0d0/engine/schema/src/com/cloud/network/dao/NetworkDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/NetworkDaoImpl.java b/engine/schema/src/com/cloud/network/dao/NetworkDaoImpl.java
index c55cf28..0f83815 100644
--- a/engine/schema/src/com/cloud/network/dao/NetworkDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/NetworkDaoImpl.java
@@ -208,6 +208,9 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long>
implements N
         VpcNetworksCount = createSearchBuilder(Long.class);
         VpcNetworksCount.and("vpcId", VpcNetworksCount.entity().getVpcId(), Op.EQ);
         VpcNetworksCount.select(null, Func.COUNT, VpcNetworksCount.entity().getId());
+        SearchBuilder<NetworkOfferingVO> join9 = _ntwkOffDao.createSearchBuilder();
+        join9.and("isSystem", join9.entity().isSystemOnly(), Op.EQ);
+        VpcNetworksCount.join("offerings", join9, VpcNetworksCount.entity().getNetworkOfferingId(),
join9.entity().getId(), JoinBuilder.JoinType.INNER);
         VpcNetworksCount.done();
 
         OfferingAccountNetworkSearch = createSearchBuilder();
@@ -587,6 +590,8 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long>
implements N
     public long countVpcNetworks(long vpcId) {
         SearchCriteria<Long> sc = VpcNetworksCount.create();
         sc.setParameters("vpcId", vpcId);
+        //offering shouldn't be system (the one used by the private gateway)
+        sc.setJoinParameters("offerings", "isSystem", false);
         return customSearch(sc, null).get(0);
     }
 


Mime
View raw message