You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2014/02/20 20:17:18 UTC

[12/50] [abbrv] git commit: updated refs/heads/ui-restyle to c64bfa5

CLOUDSTACK-5779: Fix missing clean up period for VR


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

Branch: refs/heads/ui-restyle
Commit: 161e7d93ca9d03e9aa7e7be9e12d1ad337de9b14
Parents: e1e16a2
Author: Sheng Yang <sh...@citrix.com>
Authored: Fri Feb 14 17:28:55 2014 -0800
Committer: Sheng Yang <sh...@citrix.com>
Committed: Fri Feb 14 18:10:00 2014 -0800

----------------------------------------------------------------------
 .../virtualnetwork/VirtualRoutingResource.java  | 62 ++++++++++++--------
 .../xen/resource/CitrixResourceBase.java        |  2 +-
 2 files changed, 37 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/161e7d93/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
index 3efbe33..0b90cc9 100755
--- a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
+++ b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
@@ -109,59 +109,69 @@ public class VirtualRoutingResource {
                 return new Answer(cmd, false, rc.getDetails());
             }
 
+            Answer answer;
             if (cmd instanceof SetPortForwardingRulesVpcCommand) {
-                return execute((SetPortForwardingRulesVpcCommand)cmd);
+                answer = execute((SetPortForwardingRulesVpcCommand)cmd);
             } else if (cmd instanceof SetPortForwardingRulesCommand) {
-                return execute((SetPortForwardingRulesCommand)cmd);
+                answer = execute((SetPortForwardingRulesCommand)cmd);
             } else if (cmd instanceof SetStaticRouteCommand) {
-                return execute((SetStaticRouteCommand)cmd);
+                answer = execute((SetStaticRouteCommand)cmd);
             } else if (cmd instanceof SetStaticNatRulesCommand) {
-                return execute((SetStaticNatRulesCommand)cmd);
+                answer = execute((SetStaticNatRulesCommand)cmd);
             } else if (cmd instanceof LoadBalancerConfigCommand) {
-                return execute((LoadBalancerConfigCommand)cmd);
+                answer = execute((LoadBalancerConfigCommand)cmd);
             } else if (cmd instanceof SavePasswordCommand) {
-                return execute((SavePasswordCommand)cmd);
+                answer = execute((SavePasswordCommand)cmd);
             } else if (cmd instanceof DhcpEntryCommand) {
-                return execute((DhcpEntryCommand)cmd);
+                answer = execute((DhcpEntryCommand)cmd);
             } else if (cmd instanceof CreateIpAliasCommand) {
-                return execute((CreateIpAliasCommand)cmd);
+                answer = execute((CreateIpAliasCommand)cmd);
             } else if (cmd instanceof DnsMasqConfigCommand) {
-                return execute((DnsMasqConfigCommand)cmd);
+                answer = execute((DnsMasqConfigCommand)cmd);
             } else if (cmd instanceof DeleteIpAliasCommand) {
-                return execute((DeleteIpAliasCommand)cmd);
+                answer = execute((DeleteIpAliasCommand)cmd);
             } else if (cmd instanceof VmDataCommand) {
-                return execute((VmDataCommand)cmd);
+                answer = execute((VmDataCommand)cmd);
             } else if (cmd instanceof CheckRouterCommand) {
-                return execute((CheckRouterCommand)cmd);
+                answer = execute((CheckRouterCommand)cmd);
             } else if (cmd instanceof SetFirewallRulesCommand) {
-                return execute((SetFirewallRulesCommand)cmd);
+                answer = execute((SetFirewallRulesCommand)cmd);
             } else if (cmd instanceof BumpUpPriorityCommand) {
-                return execute((BumpUpPriorityCommand)cmd);
+                answer = execute((BumpUpPriorityCommand)cmd);
             } else if (cmd instanceof RemoteAccessVpnCfgCommand) {
-                return execute((RemoteAccessVpnCfgCommand)cmd);
+                answer = execute((RemoteAccessVpnCfgCommand)cmd);
             } else if (cmd instanceof VpnUsersCfgCommand) {
-                return execute((VpnUsersCfgCommand)cmd);
+                answer = execute((VpnUsersCfgCommand)cmd);
             } else if (cmd instanceof GetDomRVersionCmd) {
-                return execute((GetDomRVersionCmd)cmd);
+                answer = execute((GetDomRVersionCmd)cmd);
             } else if (cmd instanceof Site2SiteVpnCfgCommand) {
-                return execute((Site2SiteVpnCfgCommand)cmd);
+                answer = execute((Site2SiteVpnCfgCommand)cmd);
             } else if (cmd instanceof CheckS2SVpnConnectionsCommand) {
-                return execute((CheckS2SVpnConnectionsCommand)cmd);
+                answer = execute((CheckS2SVpnConnectionsCommand)cmd);
             } else if (cmd instanceof SetMonitorServiceCommand) {
-                return execute((SetMonitorServiceCommand)cmd);
+                answer = execute((SetMonitorServiceCommand)cmd);
             } else if (cmd instanceof SetupGuestNetworkCommand) {
-                return execute((SetupGuestNetworkCommand)cmd);
+                answer = execute((SetupGuestNetworkCommand)cmd);
             } else if (cmd instanceof SetNetworkACLCommand) {
-                return execute((SetNetworkACLCommand)cmd);
+                answer = execute((SetNetworkACLCommand)cmd);
             } else if (cmd instanceof SetSourceNatCommand) {
-                return execute((SetSourceNatCommand)cmd);
+                answer = execute((SetSourceNatCommand)cmd);
             } else if (cmd instanceof IpAssocVpcCommand) {
-                return execute((IpAssocVpcCommand)cmd);
+                answer = execute((IpAssocVpcCommand)cmd);
             } else if (cmd instanceof IpAssocCommand) {
-                return execute((IpAssocCommand)cmd);
+                answer = execute((IpAssocCommand)cmd);
             } else {
-                return Answer.createUnsupportedCommandAnswer(cmd);
+                answer = Answer.createUnsupportedCommandAnswer(cmd);
             }
+
+            rc = _vrDeployer.cleanupCommand((NetworkElementCommand)cmd);
+            if (!rc.isSuccess()) {
+                s_logger.error("Failed to clean up VR command due to " + rc.getDetails());
+                // TODO fail it more properly in the future, some commands may need specific answer rather than generic answer
+                answer = new Answer(cmd, false, rc.getDetails());
+            }
+
+            return answer;
         } catch (final IllegalArgumentException e) {
             return new Answer(cmd, false, e.getMessage());
         } finally {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/161e7d93/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index 2cabc58..e463072 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -569,7 +569,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
     @Override
     public ExecutionResult cleanupCommand(NetworkElementCommand cmd) {
         if (cmd instanceof IpAssocCommand && !(cmd instanceof IpAssocVpcCommand)) {
-            cleanupNetworkElementCommand((IpAssocCommand)cmd);
+            return cleanupNetworkElementCommand((IpAssocCommand)cmd);
         }
         return new ExecutionResult(true, null);
     }