cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: updated refs/heads/master to ca907d8
Date Mon, 28 Apr 2014 13:51:18 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 3bd594c58 -> ca907d8d0


formatting

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

Branch: refs/heads/master
Commit: ca907d8d025c680c43056f02fc2be451e8d99ce5
Parents: 3bd594c
Author: Daan Hoogland <daan@onecht.net>
Authored: Mon Apr 28 15:50:05 2014 +0200
Committer: Daan Hoogland <daan@onecht.net>
Committed: Mon Apr 28 15:50:05 2014 +0200

----------------------------------------------------------------------
 .../com/cloud/network/NetworkServiceImpl.java   | 54 ++++++++++----------
 1 file changed, 27 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ca907d8d/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 c18146a..696d853 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -3768,45 +3768,45 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService
{
             return Transaction.execute(new TransactionCallbackWithException<Network, Exception>()
{
                 @Override
                 public Network doInTransaction(TransactionStatus status) throws ResourceAllocationException,
InsufficientCapacityException {
-        //lock datacenter as we need to get mac address seq from there
-        DataCenterVO dc = _dcDao.lockRow(pNtwk.getDataCenterId(), true);
+                    //lock datacenter as we need to get mac address seq from there
+                    DataCenterVO dc = _dcDao.lockRow(pNtwk.getDataCenterId(), true);
 
-        //check if we need to create guest network
+                    //check if we need to create guest network
                     Network privateNetwork = _networksDao.getPrivateNetwork(uriString, cidr,
networkOwnerId, pNtwk.getDataCenterId(), networkOfferingId);
-        if (privateNetwork == null) {
-            //create Guest network
+                    if (privateNetwork == null) {
+                        //create Guest network
                         privateNetwork = _networkMgr.createGuestNetwork(ntwkOffFinal.getId(),
networkName, displayText, gateway, cidr, uriString, null, owner, null, pNtwk,
                                 pNtwk.getDataCenterId(), ACLType.Account, null, vpcId, null,
null, true, null);
-            s_logger.debug("Created private network " + privateNetwork);
-        } else {
-            s_logger.debug("Private network already exists: " + privateNetwork);
-            //Do not allow multiple private gateways with same Vlan within a VPC
-            if (vpcId != null && vpcId.equals(privateNetwork.getVpcId())) {
-                throw new InvalidParameterValueException("Private network for the vlan: "
+ uriString + " and cidr  " + cidr + "  already exists " + "for Vpc " + vpcId
-                        + " in zone " + _entityMgr.findById(DataCenter.class, pNtwk.getDataCenterId()).getName());
-            }
-        }
+                        s_logger.debug("Created private network " + privateNetwork);
+                    } else {
+                        s_logger.debug("Private network already exists: " + privateNetwork);
+                        //Do not allow multiple private gateways with same Vlan within a
VPC
+                        if (vpcId != null && vpcId.equals(privateNetwork.getVpcId()))
{
+                            throw new InvalidParameterValueException("Private network for
the vlan: " + uriString + " and cidr  " + cidr + "  already exists " + "for Vpc " + vpcId
+                                    + " in zone " + _entityMgr.findById(DataCenter.class,
pNtwk.getDataCenterId()).getName());
+                        }
+                    }
 
-        //add entry to private_ip_address table
-        PrivateIpVO privateIp = _privateIpDao.findByIpAndSourceNetworkIdAndVpcId(privateNetwork.getId(),
startIp, vpcId);
-        if (privateIp != null) {
+                    //add entry to private_ip_address table
+                    PrivateIpVO privateIp = _privateIpDao.findByIpAndSourceNetworkIdAndVpcId(privateNetwork.getId(),
startIp, vpcId);
+                    if (privateIp != null) {
                         throw new InvalidParameterValueException("Private ip address " +
startIp + " already used for private gateway" + " in zone "
                                 + _entityMgr.findById(DataCenter.class, pNtwk.getDataCenterId()).getName());
-        }
+                    }
 
-        Long mac = dc.getMacAddress();
-        Long nextMac = mac + 1;
-        dc.setMacAddress(nextMac);
+                    Long mac = dc.getMacAddress();
+                    Long nextMac = mac + 1;
+                    dc.setMacAddress(nextMac);
 
-        privateIp = new PrivateIpVO(startIp, privateNetwork.getId(), nextMac, vpcId, sourceNat);
-        _privateIpDao.persist(privateIp);
+                    privateIp = new PrivateIpVO(startIp, privateNetwork.getId(), nextMac,
vpcId, sourceNat);
+                    _privateIpDao.persist(privateIp);
 
-        _dcDao.update(dc.getId(), dc);
+                    _dcDao.update(dc.getId(), dc);
 
-        s_logger.debug("Private network " + privateNetwork + " is created");
+                    s_logger.debug("Private network " + privateNetwork + " is created");
 
-        return privateNetwork;
-    }
+                    return privateNetwork;
+                }
             });
         } catch (Exception e) {
             ExceptionUtil.rethrowRuntime(e);


Mime
View raw message