mirror of https://github.com/apache/cloudstack.git
CID-1233087: In case of no virtual routers, fail early
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
fbbd2f8932
commit
a1e8d5eefb
|
|
@ -2530,6 +2530,9 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
|
|||
if (requiredOfferings.get(0).getState() == NetworkOffering.State.Enabled) {
|
||||
// get Virtual networks
|
||||
List<? extends Network> virtualNetworks = _networkModel.listNetworksForAccount(owner.getId(), zone.getId(), Network.GuestType.Isolated);
|
||||
if (virtualNetworks == null) {
|
||||
throw new InvalidParameterValueException("No (virtual) networks are found for account " + owner);
|
||||
}
|
||||
if (virtualNetworks.isEmpty()) {
|
||||
long physicalNetworkId = _networkModel.findPhysicalNetworkId(zone.getId(), requiredOfferings.get(0).getTags(), requiredOfferings.get(0).getTrafficType());
|
||||
// Validate physical network
|
||||
|
|
|
|||
Loading…
Reference in New Issue