incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [4/20] git commit: CLOUDSTACK-116 Guest Network created in a Sub Domain which doesn't have a network domain suffix, is assigned the network domain suffix of the zone instead of that of the Parent domain of the Sub domain
Date Mon, 17 Sep 2012 22:32:02 GMT
CLOUDSTACK-116 Guest Network created in a Sub Domain which doesn't have a network domain suffix,
is assigned the network domain suffix of the zone instead of that of the Parent domain of
the Sub domain


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

Branch: refs/heads/javelin
Commit: 16c1fd9288ef06c11e468d0d04f042c0b795e225
Parents: 6e9d7aa
Author: Mice Xia <mice_xia@tcloudcomputing.com>
Authored: Mon Sep 17 21:22:18 2012 +0800
Committer: Mice Xia <mice_xia@tcloudcomputing.com>
Committed: Mon Sep 17 21:23:41 2012 +0800

----------------------------------------------------------------------
 .../src/com/cloud/network/NetworkManagerImpl.java  |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/16c1fd92/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 292a259..7a11525 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -4846,11 +4846,19 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService,
Manag
     }
 
     private String getDomainNetworkDomain(long domainId, long zoneId) {
-        String networkDomain = _domainDao.findById(domainId).getNetworkDomain();
+        String networkDomain = null;
+        Long searchDomainId = domainId;
+        while(searchDomainId != null){
+            DomainVO domain = _domainDao.findById(searchDomainId);
+            if(domain.getNetworkDomain() != null){
+                networkDomain = domain.getNetworkDomain();
+                break;
+            }
+            searchDomainId = domain.getParent();
+        }
         if (networkDomain == null) {
             return getZoneNetworkDomain(zoneId);
         }
-
         return networkDomain;
     }
 


Mime
View raw message