bug 13871: use perzone and peraccount (no spaces in values) when compare source nat capabilities

status 13871: resolved fixed
Reviewed-by: Chiradeep Vittal
This commit is contained in:
Alena Prokharchyk 2012-02-21 10:02:23 -08:00
parent 4e9b312bf2
commit 4dea695e09
3 changed files with 4 additions and 4 deletions

View File

@ -3213,7 +3213,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
boolean perAccount = value.contains("peraccount");
boolean perZone = value.contains("perzone");
if ((perAccount && perZone) || (!perAccount && !perZone)) {
throw new InvalidParameterValueException("Either perAccount or perZone source NAT type can be specified for " + Capability.SupportedSourceNatTypes.getName());
throw new InvalidParameterValueException("Either peraccount or perzone source NAT type can be specified for " + Capability.SupportedSourceNatTypes.getName());
}
} else if (capability == Capability.RedundantRouter) {
boolean enabled = value.contains("true");
@ -3311,7 +3311,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
boolean sharedSourceNat = false;
boolean redundantRouter = false;
if ((sourceNatServiceCapabilityMap != null) && (!sourceNatServiceCapabilityMap.isEmpty())) {
String sourceNatType = sourceNatServiceCapabilityMap.get(Capability.SupportedSourceNatTypes.getName());
String sourceNatType = sourceNatServiceCapabilityMap.get(Capability.SupportedSourceNatTypes);
if (sourceNatType != null) {
_networkMgr.checkCapabilityForProvider(serviceProviderMap.get(Service.SourceNat), Service.SourceNat, Capability.SupportedSourceNatTypes, sourceNatType);
sharedSourceNat = sourceNatType.contains("perzone");

View File

@ -286,7 +286,7 @@ public class JuniperSRXExternalFirewallElement extends ExternalFirewallDeviceMan
Map<Capability, String> sourceNatCapabilities = new HashMap<Capability, String>();
// Specifies that this element supports either one source NAT rule per account, or no source NAT rules at all;
// in the latter case a shared interface NAT rule will be used
sourceNatCapabilities.put(Capability.SupportedSourceNatTypes, "per account, per zone");
sourceNatCapabilities.put(Capability.SupportedSourceNatTypes, "peraccount, perzone");
capabilities.put(Service.SourceNat, sourceNatCapabilities);
// Specifies that port forwarding rules are supported by this element

View File

@ -521,7 +521,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
capabilities.put(Service.Gateway, null);
Map<Capability, String> sourceNatCapabilities = new HashMap<Capability, String>();
sourceNatCapabilities.put(Capability.SupportedSourceNatTypes, "per account");
sourceNatCapabilities.put(Capability.SupportedSourceNatTypes, "peraccount");
sourceNatCapabilities.put(Capability.RedundantRouter, "true");
capabilities.put(Service.SourceNat, sourceNatCapabilities);