Updated Branches:
  refs/heads/master a1437ae82 -> a21a4e5ac

CLOUDSTACK-2681: Suppress failed to apply port forwarding rule error when 
rollback


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e3a32867
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e3a32867
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e3a32867

Branch: refs/heads/master
Commit: e3a32867586bbcebe04b009755bfcc116eb1a296
Parents: a1437ae
Author: Sheng Yang <[email protected]>
Authored: Fri May 24 17:08:31 2013 -0700
Committer: Sheng Yang <[email protected]>
Committed: Fri May 24 17:08:31 2013 -0700

----------------------------------------------------------------------
 .../user/firewall/CreatePortForwardingRuleCmd.java |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e3a32867/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
 
b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
index 4012852..549de76 100644
--- 
a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
@@ -198,7 +198,11 @@ public class CreatePortForwardingRuleCmd extends 
BaseAsyncCreateCmd implements P
                     _firewallService.revokeRelatedFirewallRule(getEntityId(), 
true);
                 }
 
-                _rulesService.revokePortForwardingRule(getEntityId(), true);
+                try {
+                    _rulesService.revokePortForwardingRule(getEntityId(), 
true);
+                } catch (Exception ex){
+                    //Ignore e.g. failed to apply rules to device error
+                }
 
                 throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, 
"Failed to apply port forwarding rule");
             }

Reply via email to