Skip to content

Commit e0ff137

Browse files
committed
Fix removing static NAT rules with Juniper SRX
1 parent 6dad46b commit e0ff137

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

nonoss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 6121f83fbac903fa0cdf292773271cb35f952fc1

plugins/network-elements/juniper-srx/src/main/java/com/cloud/network/resource/JuniperSrxResource.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,11 +2078,11 @@ private boolean manageStaticNatRule(SrxCommand command, String publicIp, String
20782078
xml = replaceXmlValue(xml, "rule-set", _privateZone);
20792079
xml = replaceXmlValue(xml, "from-zone", _privateZone);
20802080
xml = replaceXmlValue(xml, "rule-name", ruleName_private);
2081-
}
20822081

2083-
if (!sendRequestAndCheckResponse(command, xml, "name", ruleName_private))
2084-
{
2085-
throw new ExecutionException("Failed to delete trust static NAT rule from public IP " + publicIp + " to private IP " + privateIp);
2082+
if (!sendRequestAndCheckResponse(command, xml, "name", ruleName_private))
2083+
{
2084+
throw new ExecutionException("Failed to delete trust static NAT rule from public IP " + publicIp + " to private IP " + privateIp);
2085+
}
20862086
}
20872087
return true;
20882088
}
@@ -3568,6 +3568,7 @@ private boolean sendRequestAndCheckResponse(SrxCommand command, String xmlReques
35683568

35693569
case CHECK_IF_EXISTS:
35703570
case CHECK_IF_IN_USE:
3571+
case CHECK_PRIVATE_IF_EXISTS:
35713572
assert (keyAndValue != null && keyAndValue.length == 2) : "If the SrxCommand is " + command + ", both a key and value must be specified.";
35723573

35733574
key = keyAndValue[0];

0 commit comments

Comments
 (0)