cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject git commit: VPC: CS-15485 - dont' create a record for VPC VR private gateway nic in router_network_ref; do it for regular guest networks only
Date Fri, 06 Jul 2012 21:56:47 GMT
Updated Branches:
  refs/heads/vpc 353423ace -> 818a3c72a


VPC: CS-15485 - dont' create a record for VPC VR private gateway nic in router_network_ref;
do it for regular guest networks only

Conflicts:

	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/vm/dao/DomainRouterDaoImpl.java


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

Branch: refs/heads/vpc
Commit: 818a3c72aca539b782ebd9d8bbac925526a6b52d
Parents: 353423a
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Fri Jul 6 14:53:23 2012 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Fri Jul 6 14:57:26 2012 -0700

----------------------------------------------------------------------
 .../src/com/cloud/network/NetworkManagerImpl.java  |   11 ++++++-----
 .../src/com/cloud/vm/dao/DomainRouterDaoImpl.java  |    8 +++++++-
 2 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/818a3c72/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index d344970..0c6e5cb 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -2085,11 +2085,12 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService,
Manag
         for (NetworkElement element : _networkElements) {
             if (providersToImplement.contains(element.getProvider())) {
                 if (!isProviderEnabledInPhysicalNetwork(getPhysicalNetworkId(network), element.getProvider().getName()))
{
-                	// The physicalNetworkId will not get translated into a uuid by the reponse
serializer,
-                	// because the serializer would look up the NetworkVO class's table and
retrieve the
-                	// network id instead of the physical network id.
-                	// So just throw this exception as is. We may need to TBD by changing the
serializer.
-                	throw new CloudRuntimeException("Service provider " + element.getProvider().getName()
+ "either doesn't exist or is not enabled in physical network id: " + network.getPhysicalNetworkId());
               	
+                    // The physicalNetworkId will not get translated into a uuid by the reponse
serializer,
+                    // because the serializer would look up the NetworkVO class's table and
retrieve the
+                    // network id instead of the physical network id.
+                    // So just throw this exception as is. We may need to TBD by changing
the serializer.
+                    throw new CloudRuntimeException("Service provider " + element.getProvider().getName()
+ 
+                            " either doesn't exist or is not enabled in physical network
id: " + network.getPhysicalNetworkId());
                 }
                 if (s_logger.isDebugEnabled()) {
                     s_logger.debug("Asking " + element.getName() + " to implemenet " + network);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/818a3c72/server/src/com/cloud/vm/dao/DomainRouterDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/dao/DomainRouterDaoImpl.java b/server/src/com/cloud/vm/dao/DomainRouterDaoImpl.java
index a7d892a..259dbf5 100755
--- a/server/src/com/cloud/vm/dao/DomainRouterDaoImpl.java
+++ b/server/src/com/cloud/vm/dao/DomainRouterDaoImpl.java
@@ -26,6 +26,7 @@ import com.cloud.network.Network;
 import com.cloud.network.RouterNetworkDaoImpl;
 import com.cloud.network.RouterNetworkVO;
 import com.cloud.network.router.VirtualRouter.Role;
+import com.cloud.offering.NetworkOffering;
 import com.cloud.user.UserStatisticsVO;
 import com.cloud.user.dao.UserStatisticsDaoImpl;
 import com.cloud.utils.component.ComponentLocator;
@@ -268,7 +269,12 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO,
Long> im
         if (guestNetworks != null && !guestNetworks.isEmpty()) {
             // 2) add router to the network
             for (Network guestNetwork : guestNetworks) {
-                addRouterToGuestNetwork(router, guestNetwork);
+                if (!isRouterPartOfGuestNetwork(router.getId(), guestNetwork.getId())) {
+                    //add only when network is not private network
+                    if (!(guestNetwork.getName() != NetworkOffering.SystemPrivateGatewayNetworkOffering))
{
+                        addRouterToGuestNetwork(router, guestNetwork);
+                    }
+                }
             }
         }
        


Mime
View raw message