cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [45/50] [abbrv] git commit: updated refs/heads/master to 771d052
Date Tue, 14 Oct 2014 18:16:03 GMT
CLOUDSTACK-6278 Baremetal Advanced Networking support from commit id e06fa18ed2ee2ee6a417e089cf5ac6bde11d0079
by Frank Zhang

Conflicts:
	server/src/com/cloud/network/router/NetworkHelperImpl.java


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

Branch: refs/heads/master
Commit: 3ac2e222e8b9196aef21cd79dbb19844700e43c3
Parents: 4e21948
Author: wrodrigues <wrodrigues@schubergphilis.com>
Authored: Thu Sep 11 22:17:02 2014 +0200
Committer: wilderrodrigues <wrodrigues@schubergphilis.com>
Committed: Tue Oct 14 15:08:13 2014 +0200

----------------------------------------------------------------------
 .../cloud/network/router/NetworkHelperImpl.java | 35 +++++++-------------
 1 file changed, 12 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3ac2e222/server/src/com/cloud/network/router/NetworkHelperImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/NetworkHelperImpl.java b/server/src/com/cloud/network/router/NetworkHelperImpl.java
index f589394..5acad2c 100644
--- a/server/src/com/cloud/network/router/NetworkHelperImpl.java
+++ b/server/src/com/cloud/network/router/NetworkHelperImpl.java
@@ -30,7 +30,6 @@ import javax.inject.Inject;
 
 import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
 import org.apache.cloudstack.framework.config.ConfigKey;
-import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.log4j.Logger;
 import org.cloud.network.router.deployment.RouterDeploymentDefinition;
 
@@ -41,7 +40,6 @@ import com.cloud.agent.api.routing.NetworkElementCommand;
 import com.cloud.agent.api.to.NicTO;
 import com.cloud.agent.manager.Commands;
 import com.cloud.alert.AlertManager;
-import com.cloud.configuration.Config;
 import com.cloud.dc.ClusterVO;
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.Pod;
@@ -148,8 +146,6 @@ public class NetworkHelperImpl implements NetworkHelper {
     @Inject
     private RouterControlHelper _routerControlHelper;
     @Inject
-    private ConfigurationDao _configDao;
-    @Inject
     protected NetworkOrchestrationService _networkMgr;
 
     protected final Map<HypervisorType, ConfigKey<String>> hypervisorsMap = new
HashMap<>();
@@ -481,30 +477,23 @@ public class NetworkHelperImpl implements NetworkHelper {
         return result;
     }
 
-    protected String retrieveTemplateName(HypervisorType hType, final long datacenterId)
{
+    protected String retrieveTemplateName(final HypervisorType hType, final long datacenterId)
{
+        String templateName = null;
+
         if (hType == HypervisorType.BareMetal) {
-            String peerHvType = _configDao.getValue(Config.BaremetalPeerHypervisorType.key());
-            if (peerHvType == null) {
-                throw new CloudRuntimeException(String.format("To use baremetal in advanced
networking, you must set %s to type of hypervisor(e.g XenServer)"
-                        + " that exists in the same zone with baremetal host. That hyperivsor
is used to spring up virtual router for baremetal instance",
-                        Config.BaremetalPeerHypervisorType.key()));
-            }
+            ConfigKey<String> hypervisorConfigKey = hypervisorsMap.get(HypervisorType.VMware);
+            templateName = hypervisorConfigKey.valueIn(datacenterId);
+        } else {
+            // Returning NULL is fine because the simulator will need it when
+            // being used instead of a real hypervisor.
+            // The hypervisorsMap contains only real hypervisors.
+            ConfigKey<String> hypervisorConfigKey = hypervisorsMap.get(hType);
 
-            hType = HypervisorType.getType(peerHvType);
-            if (HypervisorType.XenServer != hType && HypervisorType.KVM != hType
&& HypervisorType.VMware != hType) {
-                throw new CloudRuntimeException(String.format("Baremetal only supports peer
hypervisor(XenServer/KVM/VMWare) right now, you specified %s", peerHvType));
+            if (hypervisorConfigKey != null) {
+                templateName = hypervisorConfigKey.valueIn(datacenterId);
             }
         }
 
-        // Returning NULL is fine because the simulator will need it when being
-        // used instead of a real hypervisor.
-        // The hypervisorsMap contains only real hypervisors.
-        String templateName = null;
-        ConfigKey<String> hypervisorConfigKey = hypervisorsMap.get(hType);
-
-        if (hypervisorConfigKey != null) {
-            templateName = hypervisorConfigKey.valueIn(datacenterId);
-        }
         return templateName;
     }
 


Mime
View raw message