mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
VPC: CS-15564 - when send the rules to the backend, form the list of rules after the rules were marked with Revoke state
Conflicts: server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
This commit is contained in:
parent
d48d4c24e7
commit
534e6d4d80
@ -13,8 +13,6 @@
|
||||
package com.cloud.network.vpc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -369,19 +367,27 @@ public class NetworkACLManagerImpl implements Manager,NetworkACLManager{
|
||||
public boolean revokeAllNetworkACLsForNetwork(long networkId, long userId, Account caller) throws ResourceUnavailableException {
|
||||
|
||||
List<FirewallRuleVO> ACLs = _firewallDao.listByNetworkAndPurpose(networkId, Purpose.NetworkACL);
|
||||
|
||||
if (ACLs.isEmpty()) {
|
||||
s_logger.debug("Found no network ACLs for network id=" + networkId);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Releasing " + ACLs.size() + " Network ACLs for network id=" + networkId);
|
||||
}
|
||||
|
||||
for (FirewallRuleVO ACL : ACLs) {
|
||||
// Mark all Firewall rules as Revoke, but don't revoke them yet - we have to revoke all rules for ip, no
|
||||
// Mark all Network ACLs rules as Revoke, but don't revoke them yet - we have to revoke all rules for ip, no
|
||||
// need to send them one by one
|
||||
revokeNetworkACL(ACL.getId(), false, caller, Account.ACCOUNT_ID_SYSTEM);
|
||||
}
|
||||
|
||||
List<FirewallRuleVO> ACLsToRevoke = _firewallDao.listByNetworkAndPurpose(networkId, Purpose.NetworkACL);
|
||||
|
||||
// now send everything to the backend
|
||||
boolean success = _firewallMgr.applyFirewallRules(ACLs, false, caller);
|
||||
|
||||
boolean success = _firewallMgr.applyFirewallRules(ACLsToRevoke, false, caller);
|
||||
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Successfully released Network ACLs for network id=" + networkId + " and # of rules now = " + ACLs.size());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user