cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chipchild...@apache.org
Subject [1/2] git commit: refs/heads/4.1 - CloudStack CLOUDSTACK-1485 Add Baremetal Provider back to 4.1 branch
Date Tue, 05 Mar 2013 16:31:43 GMT
CloudStack CLOUDSTACK-1485 Add Baremetal Provider back to 4.1 branch

fixed resolved


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

Branch: refs/heads/4.1
Commit: 22d017db9917d4457bd94907bc4ba63fdbd84803
Parents: 17e3313
Author: Frank Zhang <Frank.Zhang@citrix.com>
Authored: Mon Mar 4 14:09:05 2013 -0800
Committer: Chip Childers <chip.childers@gmail.com>
Committed: Tue Mar 5 11:24:28 2013 -0500

----------------------------------------------------------------------
 .../src/com/cloud/network/NetworkServiceImpl.java  |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/22d017db/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index fdb842a..5e33d75 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -1940,6 +1940,9 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService
{
             // add VPCVirtualRouter as the defualt network service provider
             addDefaultVpcVirtualRouterToPhysicalNetwork(pNetwork.getId());
 
+            // add baremetal as the defualt network service provider
+            addDefaultBaremetalProvidersToPhysicalNetwork(pNetwork.getId());
+            
             txn.commit();
             return pNetwork;
         } catch (Exception ex) {
@@ -2773,8 +2776,18 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService
{
 
         return nsp;
     }
-
     
+    private PhysicalNetworkServiceProvider addDefaultBaremetalProvidersToPhysicalNetwork(long
physicalNetworkId) {
+        PhysicalNetworkVO pvo = _physicalNetworkDao.findById(physicalNetworkId);
+        DataCenterVO dvo = _dcDao.findById(pvo.getDataCenterId());
+        if (dvo.getNetworkType() == NetworkType.Basic) {
+            addProviderToPhysicalNetwork(physicalNetworkId, "BaremetalDhcpProvider", null,
null);
+            addProviderToPhysicalNetwork(physicalNetworkId, "BaremetalPxeProvider", null,
null);
+            addProviderToPhysicalNetwork(physicalNetworkId, "BaremetaUserdataProvider", null,
null);
+        }
+        return null;
+    }
+
     protected boolean isNetworkSystem(Network network) {
         NetworkOffering no = _networkOfferingDao.findByIdIncludingRemoved(network.getNetworkOfferingId());
         if (no.isSystemOnly()) {


Mime
View raw message