You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2013/06/28 02:09:50 UTC

git commit: updated refs/heads/master-6-17-stable to 3357ee6

Updated Branches:
  refs/heads/master-6-17-stable b5a16cda0 -> 3357ee61c


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/3357ee61
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3357ee61
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3357ee61

Branch: refs/heads/master-6-17-stable
Commit: 3357ee61ccfbdd77d1785451340bf39d0c62e4c0
Parents: b5a16cd
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Thu Jun 27 17:09:13 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Thu Jun 27 17:09:48 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/3357ee61/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);
     }