cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ro...@apache.org
Subject [cloudstack] branch 4.11 updated: srx: Fix removing static NAT rules with Juniper SRX (#3310)
Date Mon, 03 Jun 2019 11:21:35 GMT
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch 4.11
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.11 by this push:
     new 2484527  srx: Fix removing static NAT rules with Juniper SRX (#3310)
2484527 is described below

commit 2484527cae9e810203eea8850d493737fa2336a4
Author: Richard Lawley <richard@richardlawley.com>
AuthorDate: Mon Jun 3 12:21:23 2019 +0100

    srx: Fix removing static NAT rules with Juniper SRX (#3310)
    
    Fixed the logic for deleting static NAT rules on a Juniper SRX device. Previously the
private (trust) rule was not being removed.
    
    Fixes #3309
---
 .../src/com/cloud/network/resource/JuniperSrxResource.java       | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java
b/plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java
index 20031e3..8ada819 100644
--- a/plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java
+++ b/plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java
@@ -2078,11 +2078,11 @@ public class JuniperSrxResource implements ServerResource {
                         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);
+                        }
                     }
                     return true;
                 }
@@ -3568,6 +3568,7 @@ public class JuniperSrxResource implements ServerResource {
 
             case CHECK_IF_EXISTS:
             case CHECK_IF_IN_USE:
+            case CHECK_PRIVATE_IF_EXISTS:
                 assert (keyAndValue != null && keyAndValue.length == 2) : "If the
SrxCommand is " + command + ", both a key and value must be specified.";
 
                 key = keyAndValue[0];


Mime
View raw message