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>
This commit is contained in:
Wei Zhou 2013-02-14 17:11:05 +05:30 committed by Prasanna Santhanam
parent 2dff2a85f3
commit 0ec4217aae
1 changed files with 1 additions and 0 deletions

View File

@ -471,6 +471,7 @@ public class RulesManagerImpl implements RulesManager, RulesService, Manager {
// enable static nat on the backend
s_logger.trace("Enabling static nat for ip address " + ipAddress + " and vm id=" + vmId + " on the backend");
if (applyStaticNatForIp(ipId, false, caller, false)) {
performedIpAssoc = false; // ignore unassignIPFromVpcNetwork in finally block
return true;
} else {
s_logger.warn("Failed to enable static nat rule for ip address " + ipId + " on the backend");