This is an automated email from the ASF dual-hosted git repository.

Pearl1594 pushed a commit to branch netris-improvements
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 1618383cb7da88f1384c330380026f8cf05eeb7f
Author: Pearl Dsilva <[email protected]>
AuthorDate: Wed Jun 24 10:46:45 2026 -0400

    Add a check to prevent re-adding existing ACLs
    
    * Netris - Support NAT, PF for Secondary IP
    
    * Allow PF rules to be correctly created on secondary IP of a VM on netris
    
    * unique static nat names on netris by adding public IP - handle backward 
compatibility
    
    ---------
    
    Co-authored-by: Pearl Dsilva <[email protected]>
    
    * Netris - Support for L2 networks
    
    * Add support for L2 networks in Netris
    
    * remove the need to add connectivity to identify netris provider, remove 
changes to ui and create net offering
    
    * create vpc network and use it for l2 networks
    
    * dont fail if deletion on netris doesnt succeed
    
    * remove connectivity capability
    
    * update vpc name when l2 name is updated
    
    ---------
    
    Co-authored-by: Pearl Dsilva <[email protected]>
    
    * Netris - CKS support
    
    Co-authored-by: Pearl Dsilva <[email protected]>
    
    * Netris - Enable Global Routing Flag for NATTED Dual-Stack VPCs
    
    * Set globalRouting = true, when network offering is NATTED, dual-stack
    
    * update global routing based on routing mode and ip protocol type
    
    ---------
    
    Co-authored-by: Pearl Dsilva <[email protected]>
    Co-authored-by: nvazquez <[email protected]>
    
    * Netris - Fix allocate vnets with the correct account ID so that release 
succeeds on network deletion
    
    * Fix allocate vnets with the correct account ID so that release succeeds 
on network deletion
    
    * add fix for vpc tiers as well
    
    * move entire vnet cleanup logic to trash from shutdown, so that it works 
for all network types for netris
    
    * cleanup vnets when reservation id is null
    
    ---------
    
    Co-authored-by: Pearl Dsilva <[email protected]>
    
    * Netris - Add support to include VPN service for NATTED Netris offerings
    
    * Add support to include VPN service for NATTED Netris offerings
    
    * missing changes of global routing
    
    * Remove extra space
    
    ---------
    
    Co-authored-by: Pearl Dsilva <[email protected]>
    Co-authored-by: nvazquez <[email protected]>
    
    * Netris - Support Redundant Virtual Routers for Netris VPC networks
    
    * Add support for redundant routers for Netris VPC networks
    
    * address comment
    
    * default null network mode to natted for netris
    
    * preventing vpc and ipam creation if already exists
    
    ---------
    
    Co-authored-by: Pearl Dsilva <[email protected]>
    
    * Netris - Enable autoscaling groups for Netris network offerings
    
    * Enable autoscaling groups for Netris network offerings
    
    * Fix UI loading for services when network mode changes for external 
providers and show vm autoscaling always set to true / non-editable for netris 
when LB is selected i.e, natted mode
    
    * Revert removed comment
    
    ---------
    
    Co-authored-by: Pearl Dsilva <[email protected]>
    Co-authored-by: nvazquez <[email protected]>
    
    * merge conflict
    
    * systemvm: fix VPC VPN issue when network id is bigger than 1000 on Netris
    
    * show networks for vnf nic mappings
    
    * Add a check to prevent re-adding existing ACLs
    
    * Add a check to prevent re-adding existing ACLs
    
    * change message compare statement
    
    ---------
    
    Co-authored-by: Pearl Dsilva <[email protected]>
    Co-authored-by: nvazquez <[email protected]>
    Co-authored-by: Wei Zhou <[email protected]>
---
 .../cloudstack/service/NetrisApiClientImpl.java     | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git 
a/plugins/network-elements/netris/src/main/java/org/apache/cloudstack/service/NetrisApiClientImpl.java
 
b/plugins/network-elements/netris/src/main/java/org/apache/cloudstack/service/NetrisApiClientImpl.java
index c4598ddfec4..cb4ed59333b 100644
--- 
a/plugins/network-elements/netris/src/main/java/org/apache/cloudstack/service/NetrisApiClientImpl.java
+++ 
b/plugins/network-elements/netris/src/main/java/org/apache/cloudstack/service/NetrisApiClientImpl.java
@@ -438,7 +438,7 @@ public class NetrisApiClientImpl implements NetrisApiClient 
{
                 try {
                     aclApi.apiAclPut(aclEditItem);
                 } catch (ApiException e) {
-                    if (e.getResponseBody().contains("This kind of acl already 
exists")) {
+                    if (e.getResponseBody().contains("already exists")) {
                         logger.info("Netris ACL rule: {} already exists and 
doesn't need to be updated", aclName);
                         return true;
                     }
@@ -448,7 +448,15 @@ public class NetrisApiClientImpl implements 
NetrisApiClient {
             }
             AclAddItem aclAddItem = getAclAddItem(cmd, aclName);
             aclAddItem.setVpc(vpc);
-            aclApi.apiAclPost(aclAddItem);
+            try {
+                aclApi.apiAclPost(aclAddItem);
+            } catch (ApiException e) {
+                if (e.getResponseBody() != null && 
e.getResponseBody().contains("already exists")) {
+                    logger.info("Netris ACL rule: {} already exists, skipping 
creation", aclName);
+                    return true;
+                }
+                throw e;
+            }
         } catch (ApiException e) {
             logAndThrowException(String.format("Failed to create Netris ACL: 
%s", cmd.getNetrisAclName()), e);
         }
@@ -971,13 +979,12 @@ public class NetrisApiClientImpl implements 
NetrisApiClient {
                 logger.error("Could not find the Netris LB rule with name {}", 
lbName);
                 return false;
             }
-            if (matchingLbId.isEmpty()) {
+            if (!matchingLbId.isEmpty()) {
+                L4LoadBalancerApi lbApi = 
apiClient.getApiStubForMethod(L4LoadBalancerApi.class);
+                lbApi.apiV2L4lbIdDelete(matchingLbId.get(0).intValue());
+            } else {
                 logger.warn("There doesn't seem to be any LB rule on Netris 
matching {}", lbName);
-                return true;
             }
-
-            L4LoadBalancerApi lbApi = 
apiClient.getApiStubForMethod(L4LoadBalancerApi.class);
-            lbApi.apiV2L4lbIdDelete(matchingLbId.get(0).intValue());
             if (Objects.nonNull(cidrList)) {
                 deleteAclRulesForLb(cmd);
             }

Reply via email to