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

pearl11594 pushed a commit to branch nsx-cleanup-dhcp-relay-config
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/nsx-cleanup-dhcp-relay-config 
by this push:
     new ee35ba22bdf address comment
ee35ba22bdf is described below

commit ee35ba22bdfa5f3fef4307ddc2dce0f92d4e45ec
Author: Pearl Dsilva <[email protected]>
AuthorDate: Fri Oct 6 14:50:23 2023 -0400

    address comment
---
 .../nsx/src/main/java/org/apache/cloudstack/resource/NsxResource.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/resource/NsxResource.java
 
b/plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/resource/NsxResource.java
index 00ecf1684fa..f6f0fd50fb0 100644
--- 
a/plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/resource/NsxResource.java
+++ 
b/plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/resource/NsxResource.java
@@ -364,7 +364,7 @@ public class NsxResource implements ServerResource {
             Segments segmentService = (Segments) 
nsxService.apply(Segments.class);
             segmentService.delete(segmentName);
             DhcpRelayConfigs dhcpRelayConfig = (DhcpRelayConfigs) 
nsxService.apply(DhcpRelayConfigs.class);
-            dhcpRelayConfig.delete(getDhcpRelayId(cmd));
+            dhcpRelayConfig.delete(getDhcpRelayId(cmd.getZoneName(), 
cmd.getAccountName(), cmd.getVpcName(), cmd.getTierNetwork().getName()));
         } catch (Exception e) {
             LOGGER.error(String.format("Failed to delete NSX segment: %s", 
getSegmentName(cmd.getAccountName(), cmd.getTierNetwork().getName(), 
cmd.getVpcName())));
             return new NsxAnswer(cmd, new 
CloudRuntimeException(e.getMessage()));
@@ -434,7 +434,7 @@ public class NsxResource implements ServerResource {
     private String getDhcpRelayId(String zoneName, String accountName, String 
vpcName, String networkName) {
         String suffix = "-Relay";
         if (isNull(vpcName)) {
-            return zoneName + "-" + networkName + suffix;
+            return zoneName + "-" + accountName + "-" + networkName + suffix;
         }
         return String.format("%s-%s-%s-%s%s", zoneName, accountName, vpcName, 
networkName, suffix);
     }

Reply via email to