Skip to content

Commit 4dea695

Browse files
Alena ProkharchykAlena Prokharchyk
authored andcommitted
bug 13871: use perzone and peraccount (no spaces in values) when compare source nat capabilities
status 13871: resolved fixed Reviewed-by: Chiradeep Vittal
1 parent 4e9b312 commit 4dea695

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎server/src/com/cloud/configuration/ConfigurationManagerImpl.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3213,7 +3213,7 @@ void validateSourceNatServiceCapablities(Map<Capability, String> sourceNatServic
32133213
boolean perAccount = value.contains("peraccount");
32143214
boolean perZone = value.contains("perzone");
32153215
if ((perAccount && perZone) || (!perAccount && !perZone)) {
3216-
throw new InvalidParameterValueException("Either perAccount or perZone source NAT type can be specified for " + Capability.SupportedSourceNatTypes.getName());
3216+
throw new InvalidParameterValueException("Either peraccount or perzone source NAT type can be specified for " + Capability.SupportedSourceNatTypes.getName());
32173217
}
32183218
} else if (capability == Capability.RedundantRouter) {
32193219
boolean enabled = value.contains("true");
@@ -3311,7 +3311,7 @@ public NetworkOfferingVO createNetworkOffering(long userId, String name, String
33113311
boolean sharedSourceNat = false;
33123312
boolean redundantRouter = false;
33133313
if ((sourceNatServiceCapabilityMap != null) && (!sourceNatServiceCapabilityMap.isEmpty())) {
3314-
String sourceNatType = sourceNatServiceCapabilityMap.get(Capability.SupportedSourceNatTypes.getName());
3314+
String sourceNatType = sourceNatServiceCapabilityMap.get(Capability.SupportedSourceNatTypes);
33153315
if (sourceNatType != null) {
33163316
_networkMgr.checkCapabilityForProvider(serviceProviderMap.get(Service.SourceNat), Service.SourceNat, Capability.SupportedSourceNatTypes, sourceNatType);
33173317
sharedSourceNat = sourceNatType.contains("perzone");

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ private static Map<Service, Map<Capability, String>> setCapabilities() {
286286
Map<Capability, String> sourceNatCapabilities = new HashMap<Capability, String>();
287287
// Specifies that this element supports either one source NAT rule per account, or no source NAT rules at all;
288288
// in the latter case a shared interface NAT rule will be used
289-
sourceNatCapabilities.put(Capability.SupportedSourceNatTypes, "per account, per zone");
289+
sourceNatCapabilities.put(Capability.SupportedSourceNatTypes, "peraccount, perzone");
290290
capabilities.put(Service.SourceNat, sourceNatCapabilities);
291291

292292
// Specifies that port forwarding rules are supported by this element

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ private static Map<Service, Map<Capability, String>> setCapabilities() {
521521
capabilities.put(Service.Gateway, null);
522522

523523
Map<Capability, String> sourceNatCapabilities = new HashMap<Capability, String>();
524-
sourceNatCapabilities.put(Capability.SupportedSourceNatTypes, "per account");
524+
sourceNatCapabilities.put(Capability.SupportedSourceNatTypes, "peraccount");
525525
sourceNatCapabilities.put(Capability.RedundantRouter, "true");
526526
capabilities.put(Service.SourceNat, sourceNatCapabilities);
527527

0 commit comments

Comments
 (0)