CloudStack CLOUDSTACK-1485 Add Baremetal Provider back to 4.1 branch

fixed resolved
This commit is contained in:
Frank Zhang 2013-03-04 14:09:05 -08:00 committed by Chip Childers
parent 17e3313e69
commit 22d017db99
1 changed files with 14 additions and 1 deletions

View File

@ -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()) {