bug 6123: Include last id in the vlan range

status 6123: resolved fixed
This commit is contained in:
kishan 2010-09-27 16:57:31 +05:30
parent 6e4fa7fcd1
commit ec4755a60e
2 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@ public class DataCenterVnetDaoImpl extends GenericDaoBase<DataCenterVnetVO, Long
try {
txn.start();
PreparedStatement stmt = txn.prepareAutoCloseStatement(insertVnet);
for (int i = start; i < end; i++) {
for (int i = start; i <= end; i++) {
stmt.setString(1, String.valueOf(i));
stmt.setLong(2, dcId);
stmt.addBatch();

View File

@ -729,7 +729,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager {
if (vnetRange != null) {
String[] tokens = vnetRange.split("-");
int begin = Integer.parseInt(tokens[0]);
int end = tokens.length == 1 ? (begin + 1) : Integer.parseInt(tokens[1]);
int end = tokens.length == 1 ? (begin) : Integer.parseInt(tokens[1]);
_zoneDao.deleteVnet(zoneId);
_zoneDao.addVnet(zone.getId(), begin, end);
@ -793,7 +793,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager {
try {
vnetStart = Integer.parseInt(tokens[0]);
if (tokens.length == 1) {
vnetEnd = vnetStart + 1;
vnetEnd = vnetStart;
} else {
vnetEnd = Integer.parseInt(tokens[1]);
}