CS-15526: Failed to create a guest network for basic zone.

Description:

	vlanId isn't a db ID, so removing its inclusion
	in an IdentityProxy object when throwing an
	exception. It's a string, so it was causing
	problems since it was being converted to a Long.
This commit is contained in:
Vijayendra Bhamidipati 2012-07-12 17:36:12 -07:00
parent c3a854faf2
commit 7ef5f314ee
1 changed files with 2 additions and 4 deletions

View File

@ -2943,17 +2943,15 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
if (ntwkOff.getGuestType() == GuestType.Isolated) {
if (_networksDao.countByZoneAndUri(zoneId, uri) > 0) {
List<IdentityProxy> idList = new ArrayList<IdentityProxy>();
idList.add(new IdentityProxy("vlan", Long.valueOf(vlanId), "vlanId"));
idList.add(new IdentityProxy("data_center", zoneId, "zoneId"));
throw new InvalidParameterValueException("Network with vlan of specified id already exists in zone with specified id", idList);
throw new InvalidParameterValueException("Network with vlan id: " + vlanId + " already exists in zone with specified id", idList);
}
} else {
//don't allow to create Shared network with Vlan that already exists in the zone for Isolated networks
List<IdentityProxy> idList = new ArrayList<IdentityProxy>();
idList.add(new IdentityProxy("vlan", Long.valueOf(vlanId), "vlanId"));
idList.add(new IdentityProxy("data_center", zoneId, "zoneId"));
if (_networksDao.countByZoneUriAndGuestType(zoneId, uri, GuestType.Isolated) > 0) {
throw new InvalidParameterValueException("Isolated network with vlan of specified id already exists " +
throw new InvalidParameterValueException("Isolated network with vlan id: " + vlanId + " already exists " +
"in zone with specified id", idList);
}
}