incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [24/51] [abbrv] git commit: VPC: fixed guest network shutdown
Date Fri, 15 Jun 2012 22:38:03 GMT
VPC: fixed guest network shutdown


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

Branch: refs/heads/vpc
Commit: aa2b7d2d8c6452cac2585dbc18f4fa18d386946f
Parents: 39422a3
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Mon Jun 11 15:01:51 2012 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Fri Jun 15 14:27:42 2012 -0700

----------------------------------------------------------------------
 .../router/VirtualNetworkApplianceManagerImpl.java |   18 ++++++--------
 wscript                                            |    2 +-
 2 files changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/aa2b7d2d/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index 4c8ea96..34edb0d 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -3076,7 +3076,9 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
         String dhcpRange = getGuestDhcpRange(guestNic, network, _configMgr.getZone(network.getDataCenterId()));
         
         boolean result = true;
-        long guestVlanTag = Long.parseLong(network.getBroadcastUri().getHost());
+        
+        Nic nic = _nicDao.findByInstanceIdAndNetworkId(network.getId(), router.getId());
+        long guestVlanTag = Long.parseLong(nic.getBroadcastUri().getHost());
         
         String brd = NetUtils.long2Ip(NetUtils.ip2Long(guestNic.getIp4Address()) | ~NetUtils.ip2Long(guestNic.getNetmask()));
         Integer priority = null;
@@ -3098,7 +3100,6 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
             defaultDns2 = guestNic.getDns2();
         }
         
-        NicVO nic = _nicDao.findByInstanceIdAndNetworkId(network.getId(), router.getId());
         NicProfile nicProfile = new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(),

                 _networkMgr.getNetworkRate(network.getId(), router.getId()), 
                 _networkMgr.isSecurityGroupSupportedInNetwork(network), _networkMgr.getNetworkTag(router.getHypervisorType(),
network));
@@ -3186,12 +3187,6 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
             return false;
         }
         
-        //check if router is already part of network
-        if (!_routerDao.isRouterPartOfGuestNetwork(router.getId(), network.getId())) {
-            s_logger.debug("Router " + router + " is not a part of guest network " + network
+ "; no need to unplug guest nic");
-            return true;
-        }
-        
         //Check if router is a part of the Guest network
         if (!_networkMgr.isVmPartOfNetwork(router.getId(), network.getId())) {
             s_logger.debug("Router " + router + " is not a part of the Guest network " +
network);
@@ -3208,8 +3203,11 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
         
         if (result) {
             if (result) {
-                s_logger.debug("Removing router " + router + " from network " + network);
-                _routerDao.removeRouterFromNetwork(router.getId(), network.getId());
+                //check if router is already part of network
+                if (_routerDao.isRouterPartOfGuestNetwork(router.getId(), network.getId()))
{
+                    s_logger.debug("Removing router " + router + " from network" + network);
+                    _routerDao.removeRouterFromNetwork(router.getId(), network.getId());
+                }
             }
         }
         return result;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/aa2b7d2d/wscript
----------------------------------------------------------------------
diff --git a/wscript b/wscript
index 0e05eb7..2616bba 100644
--- a/wscript
+++ b/wscript
@@ -5,7 +5,7 @@
 # if you change 'em here, you need to change it also in cloud.spec, add a %changelog entry
there, and add an entry in debian/changelog
 
 
-VERSION = '3.0.3.2012-06-11T21:29:17Z'
+VERSION = '3.0.3.2012-06-11T21:51:13Z'
 APPNAME = 'cloud'
 
 import shutil,os


Mime
View raw message