cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From muralire...@apache.org
Subject git commit: updated refs/heads/master to f53db88
Date Mon, 15 Jul 2013 10:47:00 GMT
Updated Branches:
  refs/heads/master 396a13dd0 -> f53db88ba


CLOUDSTACK-2960: [portableIPrange] CS should check the portable ip range, vlan with
existing public ip ranges and vlans

adds a validation check to ensure there is no VLAN in the zones with
same id


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

Branch: refs/heads/master
Commit: f53db88bae5c490d0d7bd9c7d6e7d47a3b293654
Parents: 396a13d
Author: Murali Reddy <muralimmreddy@gmail.com>
Authored: Mon Jul 15 16:15:20 2013 +0530
Committer: Murali Reddy <muralimmreddy@gmail.com>
Committed: Mon Jul 15 16:16:47 2013 +0530

----------------------------------------------------------------------
 .../cloud/configuration/ConfigurationManagerImpl.java    | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f53db88b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index c3209a9..7e0bc25 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -5067,6 +5067,17 @@ public class ConfigurationManagerImpl extends ManagerBase implements
Configurati
             if (!NetUtils.isValidVlan(vlanId)) {
                 throw new InvalidParameterValueException("Invalid vlan id " + vlanId);
             }
+
+            // check if there is zone vlan with same id
+            List<DataCenterVO> zones= _zoneDao.listAllZones();
+            if (zones != null && !zones.isEmpty()) {
+                for (DataCenterVO zone: zones) {
+                    if (_vlanDao.findByZoneAndVlanId(zone.getId(), vlanId) != null)
+                        throw new InvalidParameterValueException("Found a VLAN id " + vlanId
+ " already existing in"
+                                + " zone " + zone.getUuid() + " that conflicts with VLAN
id of the portable ip range being configured");
+                }
+            }
+
         }
         GlobalLock portableIpLock = GlobalLock.getInternLock("PortablePublicIpRange");
         portableIpLock.lock(5);


Mime
View raw message