cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [30/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 2a99064
Date Tue, 09 Apr 2013 13:21:07 GMT
Fixes/improvements for VPC feature:

1) Added comments to VPC/VPCService/VPCManager interfaces
2) Moved VPC offering related methods from VpcService to the new interface - VpcProvisioningService
3) Fixed static nat creation in the VPC - used to result in NPE due to invalid method referencing
while obtaining VPC VR information


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

Branch: refs/heads/marvin_refactor
Commit: 9e38c5df0fa0db3ab7056e78d68562a8df8ebe70
Parents: cb4ac1f
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Fri Mar 29 16:24:24 2013 -0700
Committer: Prasanna Santhanam <tsp@apache.org>
Committed: Sun Mar 31 22:19:14 2013 +0530

----------------------------------------------------------------------
 api/src/com/cloud/network/NetworkModel.java        |    2 +
 api/src/com/cloud/network/vpc/Vpc.java             |   26 +++---
 api/src/com/cloud/network/vpc/VpcOffering.java     |   10 +-
 .../cloud/network/vpc/VpcProvisioningService.java  |   10 +-
 api/src/com/cloud/network/vpc/VpcService.java      |   74 +++++++-------
 .../api/command/user/network/UpdateNetworkCmd.java |    2 +-
 server/src/com/cloud/network/NetworkManager.java   |    4 +-
 .../src/com/cloud/network/NetworkManagerImpl.java  |    1 -
 server/src/com/cloud/network/NetworkModelImpl.java |   13 +++
 .../src/com/cloud/network/NetworkServiceImpl.java  |    6 +
 .../router/VpcVirtualNetworkApplianceManager.java  |    2 +-
 server/src/com/cloud/network/vpc/VpcManager.java   |   26 +++---
 .../src/com/cloud/network/vpc/VpcManagerImpl.java  |   10 +-
 .../com/cloud/network/MockNetworkModelImpl.java    |    6 +
 .../test/com/cloud/vpc/MockNetworkModelImpl.java   |    6 +
 server/test/com/cloud/vpc/MockVpcManagerImpl.java  |    2 +-
 16 files changed, 115 insertions(+), 85 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/api/src/com/cloud/network/NetworkModel.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/NetworkModel.java b/api/src/com/cloud/network/NetworkModel.java
index 916f28a..c1f1674 100644
--- a/api/src/com/cloud/network/NetworkModel.java
+++ b/api/src/com/cloud/network/NetworkModel.java
@@ -261,4 +261,6 @@ public interface NetworkModel {
 	String getStartIpv6Address(long id);
 
     Nic getPlaceholderNic(Network network, Long podId);
+
+    boolean isProviderEnabledInZone(long zoneId, String provider);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/api/src/com/cloud/network/vpc/Vpc.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/vpc/Vpc.java b/api/src/com/cloud/network/vpc/Vpc.java
index 249e80f..cfeaf5a 100644
--- a/api/src/com/cloud/network/vpc/Vpc.java
+++ b/api/src/com/cloud/network/vpc/Vpc.java
@@ -21,60 +21,60 @@ import org.apache.cloudstack.api.Identity;
 import org.apache.cloudstack.api.InternalIdentity;
 
 public interface Vpc extends ControlledEntity, Identity, InternalIdentity {
-    
+
     public enum State {
         Enabled,
         Inactive
     }
 
     /**
-     * 
+     *
      * @return VPC name
      */
    String getName();
 
-   
+
    /**
     * @return the id of the zone the VPC belongs to
     */
    long getZoneId();
 
-   
+
    /**
     * @return super CIDR of the VPC. All the networks participating in VPC, should have CIDRs
that are the part of the super cidr
     */
    String getCidr();
 
    /**
-    * 
+    *
     * @return VPC state
     */
    State getState();
 
-   
+
    /**
-    * 
+    *
     * @return VPC offering id - the offering that VPC is created from
     */
    long getVpcOfferingId();
 
-   
+
    /**
-    * 
+    *
     * @return VPC display text
     */
    String getDisplayText();
 
-   
+
    /**
-    * 
+    *
     * @return VPC network domain. All networks participating in the VPC, become the part
of the same network domain
     */
    String getNetworkDomain();
 
-   
+
    /**
-    * 
+    *
     * @return true if restart is required for the VPC; false otherwise
     */
    boolean isRestartRequired();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/api/src/com/cloud/network/vpc/VpcOffering.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/vpc/VpcOffering.java b/api/src/com/cloud/network/vpc/VpcOffering.java
index 3961d0a..1c65a40 100644
--- a/api/src/com/cloud/network/vpc/VpcOffering.java
+++ b/api/src/com/cloud/network/vpc/VpcOffering.java
@@ -28,26 +28,26 @@ public interface VpcOffering extends InternalIdentity, Identity {
     public static final String defaultVPCOfferingName = "Default VPC offering";
 
     /**
-     * 
+     *
      * @return VPC offering name
      */
     String getName();
 
-    
+
     /**
      * @return VPC offering display text
      */
     String getDisplayText();
-    
+
 
     /**
-     * 
+     *
      * @return VPC offering state
      */
     State getState();
 
     /**
-     * 
+     *
      * @return true if offering is default - came with the cloudStack fresh install; false
otherwise
      */
     boolean isDefault();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/api/src/com/cloud/network/vpc/VpcProvisioningService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/vpc/VpcProvisioningService.java b/api/src/com/cloud/network/vpc/VpcProvisioningService.java
index 70676ce..2452d92 100644
--- a/api/src/com/cloud/network/vpc/VpcProvisioningService.java
+++ b/api/src/com/cloud/network/vpc/VpcProvisioningService.java
@@ -20,20 +20,20 @@ import java.util.List;
 import java.util.Map;
 
 public interface VpcProvisioningService {
-    
+
     public VpcOffering getVpcOffering(long vpcOfferingId);
-    
+
     public VpcOffering createVpcOffering(String name, String displayText, List<String>
supportedServices, Map<String, List<String>> serviceProviders);
-    
+
     List<? extends VpcOffering> listVpcOfferings(Long id, String name, String displayText,
List<String> supportedServicesStr,
             Boolean isDefault, String keyword, String state, Long startIndex, Long pageSizeVal);
-    
+
     /**
      * @param offId
      * @return
      */
     public boolean deleteVpcOffering(long offId);
-    
+
     /**
      * @param vpcOffId
      * @param vpcOfferingName

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/api/src/com/cloud/network/vpc/VpcService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/vpc/VpcService.java b/api/src/com/cloud/network/vpc/VpcService.java
index 07ce89b..cbec3ed 100644
--- a/api/src/com/cloud/network/vpc/VpcService.java
+++ b/api/src/com/cloud/network/vpc/VpcService.java
@@ -35,16 +35,16 @@ import com.cloud.utils.Pair;
 public interface VpcService {
 
     /**Returns existing VPC found by id
-     * 
+     *
      * @param vpcId
      * @return
      */
     public Vpc getVpc(long vpcId);
 
-    
+
     /**
      * Returns all the Guest networks that are part of VPC
-     * 
+     *
      * @param vpcId
      * @return
      */
@@ -52,7 +52,7 @@ public interface VpcService {
 
     /**
      * Persists VPC record in the database
-     * 
+     *
      * @param zoneId
      * @param vpcOffId
      * @param vpcOwnerId
@@ -66,10 +66,10 @@ public interface VpcService {
     public Vpc createVpc(long zoneId, long vpcOffId, long vpcOwnerId, String vpcName, String
displayText, String cidr,
             String networkDomain) throws ResourceAllocationException;
 
-    
+
     /**
      * Deletes a VPC
-     * 
+     *
      * @param vpcId
      * @return
      * @throws InsufficientCapacityException
@@ -78,10 +78,10 @@ public interface VpcService {
      */
     public boolean deleteVpc(long vpcId) throws ConcurrentOperationException, ResourceUnavailableException;
 
-    
+
     /**
      * Updates VPC with new name/displayText
-     * 
+     *
      * @param vpcId
      * @param vpcName
      * @param displayText
@@ -89,10 +89,10 @@ public interface VpcService {
      */
     public Vpc updateVpc(long vpcId, String vpcName, String displayText);
 
-    
+
     /**
      * Lists VPC(s) based on the parameters passed to the method call
-     * 
+     *
      * @param id
      * @param vpcName
      * @param displayText
@@ -120,7 +120,7 @@ public interface VpcService {
 
     /**
      * Starts VPC which includes starting VPC provider and applying all the neworking rules
on the backend
-     * 
+     *
      * @param vpcId
      * @param destroyOnFailure TODO
      * @return
@@ -133,7 +133,7 @@ public interface VpcService {
 
     /**
      * Shuts down the VPC which includes shutting down all VPC provider and rules cleanup
on the backend
-     * 
+     *
      * @param vpcId
      * @return
      * @throws ConcurrentOperationException
@@ -141,10 +141,10 @@ public interface VpcService {
      */
     boolean shutdownVpc(long vpcId) throws ConcurrentOperationException, ResourceUnavailableException;
 
-    
+
     /**
      * Restarts the VPC. VPC gets shutdown and started as a part of it
-     * 
+     *
      * @param id
      * @return
      * @throws InsufficientCapacityException
@@ -153,16 +153,16 @@ public interface VpcService {
 
     /**
      * Returns a Private gateway found in the VPC by id
-     * 
+     *
      * @param id
      * @return
      */
     PrivateGateway getVpcPrivateGateway(long id);
 
-    
+
     /**
      * Persists VPC private gateway in the Database.
-     * 
+     *
      * @param vpcId TODO
      * @param physicalNetworkId
      * @param vlan
@@ -181,7 +181,7 @@ public interface VpcService {
 
     /**
      * Applies VPC private gateway on the backend, so it becomes functional
-     * 
+     *
      * @param gatewayId
      * @param destroyOnFailure TODO
      * @return
@@ -190,10 +190,10 @@ public interface VpcService {
      */
     public PrivateGateway applyVpcPrivateGateway(long gatewayId, boolean destroyOnFailure)
throws ConcurrentOperationException, ResourceUnavailableException;
 
-    
+
     /**
      * Deletes VPC private gateway
-     * 
+     *
      * @param id
      * @return
      * @throws ResourceUnavailableException
@@ -201,76 +201,76 @@ public interface VpcService {
      */
     boolean deleteVpcPrivateGateway(long gatewayId) throws ConcurrentOperationException,
ResourceUnavailableException;
 
-    
+
     /**
      * Returns the list of Private gateways existing in the VPC
-     * 
+     *
      * @param listPrivateGatewaysCmd
      * @return
      */
     public Pair<List<PrivateGateway>, Integer> listPrivateGateway(ListPrivateGatewaysCmd
listPrivateGatewaysCmd);
 
-    
+
     /**
      * Returns Static Route found by Id
-     * 
+     *
      * @param routeId
      * @return
      */
     StaticRoute getStaticRoute(long routeId);
 
-    
+
     /**
      * Applies existing Static Routes to the VPC elements
-     * 
+     *
      * @param vpcId
      * @return
      * @throws ResourceUnavailableException
      */
     public boolean applyStaticRoutes(long vpcId) throws ResourceUnavailableException;
 
-    
+
     /**
      * Deletes static route from the backend and the database
-     * 
+     *
      * @param routeId
      * @return TODO
      * @throws ResourceUnavailableException
      */
     public boolean revokeStaticRoute(long routeId) throws ResourceUnavailableException;
 
-    
+
     /**
      * Persists static route entry in the Database
-     * 
+     *
      * @param gatewayId
      * @param cidr
      * @return
      */
     public StaticRoute createStaticRoute(long gatewayId, String cidr) throws NetworkRuleConflictException;
 
-    
+
     /**
      * Lists static routes based on parameters passed to the call
-     * 
+     *
      * @param listStaticRoutesCmd
      * @return
      */
     public Pair<List<? extends StaticRoute>, Integer> listStaticRoutes(ListStaticRoutesCmd
cmd);
 
-    
+
     /**
-     * Returns gateway (VPN or Public) existign in the VPC 
-     * 
+     * Returns gateway (VPN or Public) existign in the VPC
+     *
      * @param id
      * @return
      */
     VpcGateway getVpcGateway(long id);
 
-    
+
     /**
      * Associates IP address from the Public network, to the VPC
-     * 
+     *
      * @param ipId
      * @param vpcId
      * @return

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
index a61474e..f47e9e6 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
@@ -131,7 +131,7 @@ public class UpdateNetworkCmd extends BaseAsyncCmd {
 
         Network result = _networkService.updateGuestNetwork(getId(), getNetworkName(), getDisplayText(),
callerAccount,
                     callerUser, getNetworkDomain(), getNetworkOfferingId(), getChangeCidr(),
getGuestVmCidr());
-        
+
 
         if (result != null) {
             NetworkResponse response = _responseGenerator.createNetworkResponse(result);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/server/src/com/cloud/network/NetworkManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManager.java b/server/src/com/cloud/network/NetworkManager.java
index e961f04..851f7f5 100755
--- a/server/src/com/cloud/network/NetworkManager.java
+++ b/server/src/com/cloud/network/NetworkManager.java
@@ -20,8 +20,8 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
+
 import com.cloud.dc.DataCenter;
-import com.cloud.dc.DataCenterVO;
 import com.cloud.dc.Pod;
 import com.cloud.dc.Vlan.VlanType;
 import com.cloud.deploy.DataCenterDeployment;
@@ -51,13 +51,11 @@ import com.cloud.user.User;
 import com.cloud.utils.Pair;
 import com.cloud.vm.Nic;
 import com.cloud.vm.NicProfile;
-import com.cloud.vm.NicSecondaryIp;
 import com.cloud.vm.NicVO;
 import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VMInstanceVO;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
-import com.cloud.vm.VirtualMachineProfileImpl;
 
 /**
  * NetworkManager manages the network for the different end users.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/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 e980b0f..08a3400 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -1528,7 +1528,6 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager,
L
         // associate a source NAT IP (if one isn't already associated with the network)
 
         boolean sharedSourceNat = offering.getSharedSourceNat();
-        DataCenter zone = _dcDao.findById(network.getDataCenterId());
         if (network.getGuestType() == Network.GuestType.Isolated
                && _networkModel.areServicesSupportedInNetwork(network.getId(), Service.SourceNat)
                && !sharedSourceNat) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/server/src/com/cloud/network/NetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java
index e45818f..e867641 100644
--- a/server/src/com/cloud/network/NetworkModelImpl.java
+++ b/server/src/com/cloud/network/NetworkModelImpl.java
@@ -1214,6 +1214,19 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel
{
     }
 
     @Override
+    public boolean isProviderEnabledInZone(long zoneId, String provider)
+    {
+        //the provider has to be enabled at least in one network in the zone
+        for (PhysicalNetwork pNtwk : _physicalNetworkDao.listByZone(zoneId)) {
+            if (isProviderEnabledInPhysicalNetwork(pNtwk.getId(), provider)) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    @Override
     public String getNetworkTag(HypervisorType hType, Network network) {
         // no network tag for control traffic type
         TrafficType effectiveTrafficType = network.getTrafficType();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/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 d503459..8d555c1 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -1723,6 +1723,12 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService
{
             _vpcMgr.validateNtwkOffForNtwkInVpc(networkId, networkOfferingId, null, null,
vpc, null, _accountMgr.getAccount(network.getAccountId()));
         }
 
+        //perform below validation if the network is vpc network
+        if (network.getVpcId() != null && networkOfferingId != null) {
+            Vpc vpc = _vpcMgr.getVpc(network.getVpcId());
+            _vpcMgr.validateNtwkOffForNtwkInVpc(networkId, networkOfferingId, null, null,
vpc, null, _accountMgr.getAccount(network.getAccountId()));
+        }
+
         // don't allow to update network in Destroy state
         if (network.getState() == Network.State.Destroy) {
             throw new InvalidParameterValueException("Don't allow to update network in state
" + Network.State.Destroy);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManager.java b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManager.java
index 76c8aa8..f59461c 100644
--- a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManager.java
+++ b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManager.java
@@ -101,7 +101,7 @@ public interface VpcVirtualNetworkApplianceManager extends VirtualNetworkApplian
      * @throws ResourceUnavailableException
      */
     boolean stopSite2SiteVpn(Site2SiteVpnConnection conn, VirtualRouter router) throws ResourceUnavailableException;
-    
+
     /**
      * @param vpcId
      * @return

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/server/src/com/cloud/network/vpc/VpcManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/VpcManager.java b/server/src/com/cloud/network/vpc/VpcManager.java
index 84ab8ef..686e18a 100644
--- a/server/src/com/cloud/network/vpc/VpcManager.java
+++ b/server/src/com/cloud/network/vpc/VpcManager.java
@@ -47,10 +47,10 @@ public interface VpcManager extends VpcService{
      */
     List<? extends Vpc> getVpcsForAccount(long accountId);
 
-    
+
     /**
      * Destroys the VPC
-     * 
+     *
      * @param vpc
      * @param caller TODO
      * @param callerUserId TODO
@@ -63,7 +63,7 @@ public interface VpcManager extends VpcService{
 
     /**
      * Returns true if the IP is allocated to the VPC; false otherwise
-     * 
+     *
      * @param ip
      * @return
      */
@@ -72,7 +72,7 @@ public interface VpcManager extends VpcService{
 
     /**
      * Disassociates the public IP address from VPC
-     * 
+     *
      * @param ipId
      * @param networkId
      */
@@ -81,7 +81,7 @@ public interface VpcManager extends VpcService{
 
     /**
      * Creates guest network in the VPC
-     * 
+     *
      * @param ntwkOffId
      * @param name
      * @param displayText
@@ -110,7 +110,7 @@ public interface VpcManager extends VpcService{
 
     /**
      * Assigns source nat public IP address to VPC
-     * 
+     *
      * @param owner
      * @param vpc
      * @return public IP address object
@@ -122,7 +122,7 @@ public interface VpcManager extends VpcService{
 
     /**
      * Validates network offering to find if it can be used for network creation in VPC
-     * 
+     *
      * @param guestNtwkOff
      * @param supportedSvcs TODO
      */
@@ -133,16 +133,16 @@ public interface VpcManager extends VpcService{
      * @return list of hypervisors that are supported by VPC
      */
     List<HypervisorType> getSupportedVpcHypervisors();
-    
-    
+
+
     /**
      * Lists all the services and providers that the current VPC suppots
      * @param vpcOffId
-     * @return map of Service to Provider(s) map 
+     * @return map of Service to Provider(s) map
      */
     Map<Service, Set<Provider>> getVpcOffSvcProvidersMap(long vpcOffId);
-    
-    
+
+
     /**
      * Returns VPC that is ready to be used
      * @param vpcId
@@ -152,7 +152,7 @@ public interface VpcManager extends VpcService{
 
 
     /**
-     * Performs network offering validation to determine if it can be used for network upgrade
inside the VPC 
+     * Performs network offering validation to determine if it can be used for network upgrade
inside the VPC
      * @param networkId
      * @param newNtwkOffId
      * @param newCidr

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/server/src/com/cloud/network/vpc/VpcManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
index 3948f2e..ec2564c 100644
--- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
@@ -1002,7 +1002,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager,
VpcProvis
     
     @DB
     @Override
-    public void validateNtwkOffForNtwkInVpc(Long networkId, long newNtwkOffId, String newCidr,

+    public void validateNtwkOffForNtwkInVpc(Long networkId, long newNtwkOffId, String newCidr,
             String newNetworkDomain, Vpc vpc, String gateway, Account networkOwner) {
         
         NetworkOffering guestNtwkOff = _configMgr.getNetworkOffering(newNtwkOffId);
@@ -1010,10 +1010,10 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager,
VpcProvis
         if (guestNtwkOff == null) {
             throw new InvalidParameterValueException("Can't find network offering by id specified");
         }
-        
+
         if (networkId == null) {
             //1) Validate attributes that has to be passed in when create new guest network
-            validateNewVpcGuestNetwork(newCidr, gateway, networkOwner, vpc, newNetworkDomain);

+            validateNewVpcGuestNetwork(newCidr, gateway, networkOwner, vpc, newNetworkDomain);
         }
 
         //2) validate network offering attributes
@@ -1255,7 +1255,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager,
VpcProvis
         }  
     }
     
-    
+
     @Override
     public PrivateGateway getVpcPrivateGateway(long id) {
         VpcGateway gateway = _vpcGatewayDao.findById(id);
@@ -1996,7 +1996,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager,
VpcProvis
 
         return ipToReturn;
     }
-    
+
 
     @Override
     public List<HypervisorType> getSupportedVpcHypervisors() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/server/test/com/cloud/network/MockNetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/MockNetworkModelImpl.java b/server/test/com/cloud/network/MockNetworkModelImpl.java
index b926519..c578965 100644
--- a/server/test/com/cloud/network/MockNetworkModelImpl.java
+++ b/server/test/com/cloud/network/MockNetworkModelImpl.java
@@ -844,4 +844,10 @@ public class MockNetworkModelImpl extends ManagerBase implements NetworkModel
{
         // TODO Auto-generated method stub
         return null;
     }
+
+    @Override
+    public boolean isProviderEnabledInZone(long zoneId, String provider) {
+        // TODO Auto-generated method stub
+        return false;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/server/test/com/cloud/vpc/MockNetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockNetworkModelImpl.java b/server/test/com/cloud/vpc/MockNetworkModelImpl.java
index b05e8ea..e1534cb 100644
--- a/server/test/com/cloud/vpc/MockNetworkModelImpl.java
+++ b/server/test/com/cloud/vpc/MockNetworkModelImpl.java
@@ -857,4 +857,10 @@ public class MockNetworkModelImpl extends ManagerBase implements NetworkModel
{
         return null;
     }
 
+    @Override
+    public boolean isProviderEnabledInZone(long zoneId, String provider) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e38c5df/server/test/com/cloud/vpc/MockVpcManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockVpcManagerImpl.java b/server/test/com/cloud/vpc/MockVpcManagerImpl.java
index 0f26928..44a3765 100644
--- a/server/test/com/cloud/vpc/MockVpcManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockVpcManagerImpl.java
@@ -380,7 +380,7 @@ public class MockVpcManagerImpl extends ManagerBase implements VpcManager
{
     @Override
     public void validateNtwkOffForNtwkInVpc(Long networkId, long newNtwkOffId, String newCidr,
String newNetworkDomain, Vpc vpc, String gateway, Account networkOwner) {
         // TODO Auto-generated method stub
-        
+
     }
 
 }


Mime
View raw message