From 7c46cc958049c815337f42bfde788bbe9fba4811 Mon Sep 17 00:00:00 2001 From: Kishan Kavala Date: Mon, 24 Jun 2013 16:16:14 +0530 Subject: [PATCH] CLOUDSTACK-3149: Allow default ACLs when creating tier with ACL --- server/src/com/cloud/network/NetworkServiceImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java index e7de69e8660..5e900bbaaa4 100755 --- a/server/src/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/com/cloud/network/NetworkServiceImpl.java @@ -1298,8 +1298,12 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { throw new InvalidParameterValueException("Unable to find specified NetworkACL"); } - if(!vpcId.equals(acl.getVpcId())){ - throw new InvalidParameterValueException("ACL: "+aclId+" do not belong to the VPC"); + if(aclId != NetworkACL.DEFAULT_DENY && aclId != NetworkACL.DEFAULT_ALLOW) { + //ACL is not default DENY/ALLOW + // ACL should be associated with a VPC + if(!vpcId.equals(acl.getVpcId())){ + throw new InvalidParameterValueException("ACL: "+aclId+" do not belong to the VPC"); + } } } network = _vpcMgr.createVpcGuestNetwork(networkOfferingId, name, displayText, gateway, cidr, vlanId,