bug 14295: allow regular user to create network with the custom cidr

status 14295: resolved fixed

Conflicts:

	server/src/com/cloud/network/NetworkManagerImpl.java
This commit is contained in:
Alena Prokharchyk 2012-03-14 10:45:54 -07:00 committed by Salvatore Orlando
parent b62c26c606
commit 3b4690424d
1 changed files with 13 additions and 0 deletions

View File

@ -2225,6 +2225,13 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
InvalidParameterValueException ex = new InvalidParameterValueException("Unable to find network offering by specified id");
if (ntwkOff != null) {
ex.addProxyObject(ntwkOff, networkOfferingId, "networkOfferingId");
// Get the VO object's table name.
String tablename = AnnotationHelper.getTableName(ntwkOff);
if (tablename != null) {
ex.addProxyObject(tablename, networkOfferingId, "networkOfferingId");
} else {
s_logger.info("\nCould not retrieve table name (annotation) from " + tablename + " VO proxy object\n");
}
throw ex;
}
throw ex;
@ -2398,6 +2405,12 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
if (createVlan && !ntwkOff.getSpecifyIpRanges()) {
InvalidParameterValueException ex = new InvalidParameterValueException("Network offering with specified id doesn't support adding multiple ip ranges");
ex.addProxyObject(ntwkOff, ntwkOff.getId(), "networkOfferingId");
String tablename = AnnotationHelper.getTableName(ntwkOff);
if (tablename != null) {
ex.addProxyObject(tablename, ntwkOff.getId(), "networkOfferingId");
} else {
s_logger.info("\nCould not retrieve table name (annotation) from " + tablename + " VO proxy object\n");
}
throw ex;
}