You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ja...@apache.org on 2013/12/11 06:33:31 UTC
git commit: updated refs/heads/4.3 to 9a5cf61
Updated Branches:
refs/heads/4.3 dadcc8a38 -> 9a5cf614a
CLOUDSTACK-5244 Fixed issue with applying acl items of acl to private gateway
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9a5cf614
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9a5cf614
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9a5cf614
Branch: refs/heads/4.3
Commit: 9a5cf614abd01540d711dfcc450a5089f085cfce
Parents: dadcc8a
Author: Jayapal <ja...@apache.org>
Authored: Wed Dec 11 10:42:40 2013 +0530
Committer: Jayapal <ja...@apache.org>
Committed: Wed Dec 11 10:43:00 2013 +0530
----------------------------------------------------------------------
server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java | 5 ++++-
server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java | 6 ++++--
2 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a5cf614/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java b/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
index 1ea5dd0..7bb8b13 100644
--- a/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
@@ -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);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a5cf614/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
index b925c8b..e91af57 100644
--- a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
+++ b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
@@ -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);