Skip to content

Commit 079f920

Browse files
author
Alena Prokharchyk
committed
CreateVPC: validate that the zone exists before checking its attributes
1 parent 7e96bf5 commit 079f920

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

server/src/com/cloud/network/vpc/VpcManagerImpl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,10 @@ public Vpc createVpc(long zoneId, long vpcOffId, long vpcOwnerId, String vpcName
595595

596596
//Validate zone
597597
DataCenter zone = _configMgr.getZone(zoneId);
598+
if (zone == null) {
599+
throw new InvalidParameterValueException("Can't find zone by id specified");
600+
}
601+
598602
if (Grouping.AllocationState.Disabled == zone.getAllocationState() && !_accountMgr.isRootAdmin(caller.getType())) {
599603
// See DataCenterVO.java
600604
PermissionDeniedException ex = new PermissionDeniedException("Cannot perform this operation since specified Zone is currently disabled");

0 commit comments

Comments
 (0)