Skip to content

Commit 48806fc

Browse files
author
Alena Prokharchyk
committed
VPC: CS-16179 - only offerings in Enabled state can be used for VPC creation
Reviewed-by: Frank Zhang Conflicts: server/src/com/cloud/network/vpc/VpcManagerImpl.java
1 parent 3609e44 commit 48806fc

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,9 @@ public Vpc createVpc(long zoneId, long vpcOffId, long vpcOwnerId, String vpcName
528528

529529
// Validate vpc offering
530530
VpcOfferingVO vpcOff = _vpcOffDao.findById(vpcOffId);
531-
if (vpcOff == null) {
532-
InvalidParameterValueException ex = new InvalidParameterValueException("Unable to find vpc offering by specified id");
531+
if (vpcOff == null || vpcOff.getState() != State.Enabled) {
532+
InvalidParameterValueException ex = new InvalidParameterValueException("Unable to find vpc offering in " + State.Enabled +
533+
" state by specified id");
533534
ex.addProxyObject("vpc_offerings", vpcOffId, "vpcOfferingId");
534535
throw ex;
535536
}

0 commit comments

Comments
 (0)