CLOUDSTACK-5244 Fixed issue with applying acl items of acl to private gateway

This commit is contained in:
Jayapal 2013-12-11 10:42:40 +05:30
parent dadcc8a386
commit 9a5cf614ab
2 changed files with 8 additions and 3 deletions

View File

@ -81,6 +81,8 @@ public class NetworkACLManagerImpl extends ManagerBase implements NetworkACLMana
ConfigurationManager _configMgr;
@Inject
EntityManager _entityMgr;
@Inject
VpcService _vpcSvc;
@Override
public NetworkACL createNetworkACL(String name, String description, long vpcId) {
@ -105,7 +107,8 @@ public class NetworkACLManagerImpl extends ManagerBase implements NetworkACLMana
List<VpcGatewayVO> vpcGateways = _vpcGatewayDao.listByAclIdAndType(aclId, VpcGateway.Type.Private);
for (VpcGatewayVO vpcGateway : vpcGateways) {
PrivateGateway privateGateway = _entityMgr.findById(PrivateGateway.class, vpcGateway.getId());
PrivateGateway privateGateway = _vpcSvc.getVpcPrivateGateway(vpcGateway.getId());
if (!applyACLToPrivateGw(privateGateway)) {
aclApplyStatus = false;
s_logger.debug("failed to apply network acl item on private gateway " + privateGateway.getId() + "acl id " + aclId);

View File

@ -93,6 +93,9 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
@Inject
VpcDao _vpcDao;
@Inject
VpcService _vpcSvc;
@Override
public NetworkACL createNetworkACL(String name, String description, long vpcId) {
Account caller = CallContext.current().getCallingAccount();
@ -239,8 +242,7 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
throw new InvalidParameterValueException("private gateway: "+privateGatewayId+" and ACL: "+aclId+" do not belong to the same VPC");
}
}
PrivateGateway privateGateway = _entityMgr.findById(PrivateGateway.class, privateGatewayId);
PrivateGateway privateGateway = _vpcSvc.getVpcPrivateGateway(gateway.getId());
_accountMgr.checkAccess(caller, null, true, privateGateway);
return _networkAclMgr.replaceNetworkACLForPrivateGw(acl, privateGateway);