You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2019/06/03 11:23:11 UTC

[GitHub] [cloudstack] anuragaw commented on a change in pull request #3310: Fix removing static NAT rules with Juniper SRX

anuragaw commented on a change in pull request #3310: Fix removing static NAT rules with Juniper SRX
URL: https://github.com/apache/cloudstack/pull/3310#discussion_r289797663
 
 

 ##########
 File path: plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java
 ##########
 @@ -2078,11 +2078,11 @@ private boolean manageStaticNatRule(SrxCommand command, String publicIp, String
                         xml = replaceXmlValue(xml, "rule-set", _privateZone);
                         xml = replaceXmlValue(xml, "from-zone", _privateZone);
                         xml = replaceXmlValue(xml, "rule-name", ruleName_private);
-                    }
 
-                    if (!sendRequestAndCheckResponse(command, xml, "name", ruleName_private))
-                    {
-                        throw new ExecutionException("Failed to delete trust static NAT rule from public IP " + publicIp + " to private IP " + privateIp);
+                        if (!sendRequestAndCheckResponse(command, xml, "name", ruleName_private))
+                        {
+                            throw new ExecutionException("Failed to delete trust static NAT rule from public IP " + publicIp + " to private IP " + privateIp);
+                        }
 
 Review comment:
   nit- This is one confusing else block :/ I don't think we need the else at all. Essentially it's about sending command and post that checking if private rules delete exists and execute that. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services