Skip to content

Commit 0ec4217

Browse files
ustcweizhouPrasanna Santhanam
authored andcommitted
ignore unassignIPFromVpcNetwork in finally block of EnableStaticNat
unassignIPFromVpcNetwork processing should not execute when EnableStaticNat succeed. Without this patch, unassignIPFromVpcNetwork will execute whenever EnableStaticNat is successful or failed Reviewed-by: https://reviews.apache.org/r/9443/ Signed-off-by: Prasanna Santhanam <tsp@apache.org>
1 parent 2dff2a8 commit 0ec4217

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎server/src/com/cloud/network/rules/RulesManagerImpl.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ public boolean enableStaticNat(long ipId, long vmId, long networkId, boolean isS
471471
// enable static nat on the backend
472472
s_logger.trace("Enabling static nat for ip address " + ipAddress + " and vm id=" + vmId + " on the backend");
473473
if (applyStaticNatForIp(ipId, false, caller, false)) {
474+
performedIpAssoc = false; // ignore unassignIPFromVpcNetwork in finally block
474475
return true;
475476
} else {
476477
s_logger.warn("Failed to enable static nat rule for ip address " + ipId + " on the backend");

0 commit comments

Comments
 (0)