Skip to content

Commit 1903292

Browse files
author
Alena Prokharchyk
committed
VPC:
1) CS-15692 - ipAddress is always null for NetworkACL rule 2) CS-15699 - redundant router = true when provider is VirtualRouter 3) CS-15701 - fixed error message Conflicts: server/src/com/cloud/network/vpc/VpcManagerImpl.java
1 parent 110903a commit 1903292

5 files changed

Lines changed: 11 additions & 8 deletions

File tree

‎awsapi.log.2012-07-25.gz‎

1.01 KB
Binary file not shown.

‎server/src/com/cloud/network/element/VpcVirtualRouterElement.java‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,13 @@ private static Map<Service, Map<Capability, String>> setCapabilities() {
287287
Map<Service, Map<Capability, String>> capabilities = new HashMap<Service, Map<Capability, String>>();
288288
capabilities.putAll(VirtualRouterElement.capabilities);
289289

290-
Map<Capability, String> sourceNatCapabilities = capabilities.get(Service.SourceNat);
290+
Map<Capability, String> sourceNatCapabilities = new HashMap<Capability, String>();
291+
sourceNatCapabilities.putAll(capabilities.get(Service.SourceNat));
291292
sourceNatCapabilities.put(Capability.RedundantRouter, "false");
292293
capabilities.put(Service.SourceNat, sourceNatCapabilities);
293294

294-
Map<Capability, String> vpnCapabilities = capabilities.get(Service.Vpn);
295+
Map<Capability, String> vpnCapabilities = new HashMap<Capability, String>();
296+
vpnCapabilities.putAll(capabilities.get(Service.Vpn));
295297
vpnCapabilities.put(Capability.VpnTypes, "s2svpn");
296298
capabilities.put(Service.Vpn, vpnCapabilities);
297299

‎server/src/com/cloud/network/firewall/FirewallManagerImpl.java‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,11 @@ public void removeRule(FirewallRule rule) {
455455
//remove the rule
456456
_firewallDao.remove(rule.getId());
457457

458-
//if the rule is the last one for the ip address assigned to VPC, unassign it from the network
459-
IpAddress ip = _ipAddressDao.findById(rule.getSourceIpAddressId());
460-
_networkMgr.unassignIPFromVpcNetwork(ip.getId(), rule.getNetworkId());
458+
if (rule.getSourceIpAddressId() != null) {
459+
//if the rule is the last one for the ip address assigned to VPC, unassign it from the network
460+
IpAddress ip = _ipAddressDao.findById(rule.getSourceIpAddressId());
461+
_networkMgr.unassignIPFromVpcNetwork(ip.getId(), rule.getNetworkId());
462+
}
461463
}
462464

463465
@Override

‎server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ protected void finalizeNetworkRulesForNetwork(Commands cmds, DomainRouterVO rout
881881

882882
super.finalizeNetworkRulesForNetwork(cmds, router, provider, guestNetworkId);
883883

884-
if (router.getVpcId() == null) {
884+
if (router.getVpcId() != null) {
885885
if (_networkMgr.isProviderSupportServiceInNetwork(guestNetworkId, Service.NetworkACL, Provider.VPCVirtualRouter)) {
886886
List<? extends FirewallRule> networkACLs = _networkACLMgr.listNetworkACLs(guestNetworkId);
887887
s_logger.debug("Found " + networkACLs.size() + " network ACLs to apply as a part of VPC VR " + router

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,7 @@ public void validateGuestNtkwForVpc(NetworkOffering guestNtwkOff, String cidr, S
893893
&& _ntwkMgr.areServicesSupportedByNetworkOffering(guestNtwkOff.getId(), Service.SourceNat))) {
894894

895895
throw new InvalidParameterValueException("Only networks of type " + GuestType.Isolated + " with service "
896-
+ Service.SourceNat +
897-
" can be added as a part of VPC");
896+
+ Service.SourceNat + " can be added as a part of VPC");
898897
}
899898

900899
//3) No redundant router support

0 commit comments

Comments
 (0)