cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [04/50] [abbrv] git commit: updated refs/heads/vpc-refactor to a8cb7c1
Date Fri, 03 Oct 2014 11:11:42 GMT
Fixing null pointers during vpc router deployment


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

Branch: refs/heads/vpc-refactor
Commit: 8a1462c9cc345b9759abb412c5a4b97ec6d8230b
Parents: 6852f31
Author: Antonio Fornie <afornie@schubergphilis.com>
Authored: Thu Jul 17 04:51:46 2014 -0500
Committer: Wilder Rodrigues <wrodrigues@schubergphilis.com>
Committed: Fri Oct 3 06:21:26 2014 +0200

----------------------------------------------------------------------
 .../network/router/NetworkGeneralHelper.java    |  2 +-
 .../deployment/RouterDeploymentDefinition.java  |  3 +-
 .../VpcRouterDeploymentDefinition.java          | 34 +++++++-------------
 3 files changed, 13 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8a1462c9/server/src/com/cloud/network/router/NetworkGeneralHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/NetworkGeneralHelper.java b/server/src/com/cloud/network/router/NetworkGeneralHelper.java
index fc249aa..28ff08f 100644
--- a/server/src/com/cloud/network/router/NetworkGeneralHelper.java
+++ b/server/src/com/cloud/network/router/NetworkGeneralHelper.java
@@ -538,7 +538,7 @@ public class NetworkGeneralHelper {
                 hypervisors.add(defaults);
             } else {
                 //if there is no default hypervisor, get it from the cluster
-                hypervisors = resourceMgr.getSupportedHypervisorTypes(dest.getDataCenter().getId(),
true, routerDeploymentDefinition.getPodId());
+                hypervisors = resourceMgr.getSupportedHypervisorTypes(dest.getDataCenter().getId(),
true, routerDeploymentDefinition.getPlan().getPodId());
             }
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8a1462c9/server/src/org/cloud/network/router/deployment/RouterDeploymentDefinition.java
----------------------------------------------------------------------
diff --git a/server/src/org/cloud/network/router/deployment/RouterDeploymentDefinition.java
b/server/src/org/cloud/network/router/deployment/RouterDeploymentDefinition.java
index 41ec4b3..df9d49b 100644
--- a/server/src/org/cloud/network/router/deployment/RouterDeploymentDefinition.java
+++ b/server/src/org/cloud/network/router/deployment/RouterDeploymentDefinition.java
@@ -177,7 +177,7 @@ public class RouterDeploymentDefinition {
         return dest.getPod();
     }
     public Long getPodId() {
-        return dest.getPod().getId();
+        return dest.getPod() == null ? null : dest.getPod().getId();
     }
 
     public List<DomainRouterVO> getRouters() {
@@ -207,7 +207,6 @@ public class RouterDeploymentDefinition {
         this.plan = new DataCenterDeployment(dcId, podId, null, null, null, null);
     }
 
-
     public List<DomainRouterVO> deployVirtualRouter()
             throws InsufficientCapacityException,
             ConcurrentOperationException, ResourceUnavailableException {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8a1462c9/server/src/org/cloud/network/router/deployment/VpcRouterDeploymentDefinition.java
----------------------------------------------------------------------
diff --git a/server/src/org/cloud/network/router/deployment/VpcRouterDeploymentDefinition.java
b/server/src/org/cloud/network/router/deployment/VpcRouterDeploymentDefinition.java
index c592efc..6111754 100644
--- a/server/src/org/cloud/network/router/deployment/VpcRouterDeploymentDefinition.java
+++ b/server/src/org/cloud/network/router/deployment/VpcRouterDeploymentDefinition.java
@@ -7,12 +7,10 @@ import java.util.List;
 import java.util.Map;
 import java.util.TreeSet;
 
-import javax.inject.Inject;
-
-import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
 import org.apache.log4j.Logger;
 
 import com.cloud.dc.dao.VlanDao;
+import com.cloud.deploy.DataCenterDeployment;
 import com.cloud.deploy.DeployDestination;
 import com.cloud.exception.ConcurrentOperationException;
 import com.cloud.exception.InsufficientAddressCapacityException;
@@ -22,7 +20,6 @@ import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.exception.StorageUnavailableException;
 import com.cloud.network.IpAddress;
 import com.cloud.network.Network;
-import com.cloud.network.NetworkModel;
 import com.cloud.network.Networks.BroadcastDomainType;
 import com.cloud.network.Networks.IsolationType;
 import com.cloud.network.PhysicalNetwork;
@@ -30,11 +27,8 @@ import com.cloud.network.PhysicalNetworkServiceProvider;
 import com.cloud.network.VirtualRouterProvider;
 import com.cloud.network.VirtualRouterProvider.Type;
 import com.cloud.network.addr.PublicIp;
-import com.cloud.network.dao.IPAddressDao;
 import com.cloud.network.dao.IPAddressVO;
 import com.cloud.network.dao.PhysicalNetworkDao;
-import com.cloud.network.dao.PhysicalNetworkServiceProviderDao;
-import com.cloud.network.dao.VirtualRouterProviderDao;
 import com.cloud.network.router.VirtualNwStatus;
 import com.cloud.network.vpc.PrivateGateway;
 import com.cloud.network.vpc.Vpc;
@@ -53,27 +47,11 @@ import com.cloud.vm.VirtualMachineProfile.Param;
 public class VpcRouterDeploymentDefinition extends RouterDeploymentDefinition {
     private static final Logger logger = Logger.getLogger(VpcRouterDeploymentDefinition.class);
 
-    @Inject
     protected VpcDao vpcDao;
-    @Inject
     protected VpcOfferingDao vpcOffDao;
-    @Inject
     protected PhysicalNetworkDao pNtwkDao;
-    @Inject
     protected VpcManager vpcMgr;
-    @Inject
-    protected PhysicalNetworkServiceProviderDao physicalProviderDao;
-    @Inject
     protected VlanDao vlanDao;
-    @Inject
-    protected IPAddressDao ipAddressDao;
-    @Inject
-    protected NetworkOrchestrationService networkMgr;
-    @Inject
-    protected NetworkModel networkModel;
-    @Inject
-    protected VirtualRouterProviderDao vrProviderDao;
-
 
     protected Vpc vpc;
 
@@ -87,6 +65,11 @@ public class VpcRouterDeploymentDefinition extends RouterDeploymentDefinition
{
     }
 
     @Override
+    public Vpc getVpc() {
+        return this.vpc;
+    }
+
+    @Override
     public boolean isVpcRouter() {
         return true;
     }
@@ -238,4 +221,9 @@ public class VpcRouterDeploymentDefinition extends RouterDeploymentDefinition
{
         this.routers = vpcHelper.getVpcRouters(this.getVpc().getId());
     }
 
+    @Override
+    public void generateDeploymentPlan() {
+        final long dcId = this.dest.getDataCenter().getId();
+        this.plan = new DataCenterDeployment(dcId);
+    }
 }


Mime
View raw message