cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yas...@apache.org
Subject [2/3] git commit: updated refs/heads/master to deb55ac
Date Sat, 15 Feb 2014 02:10:23 GMT
Remove SetupGuestNetworkAnswer

It's unnecessary and not different from Answer itself.


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

Branch: refs/heads/master
Commit: 6bde675f87111e13ce7d2e036fdf4c67177929c6
Parents: 161e7d9
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Fri Feb 14 17:28:55 2014 -0800
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Fri Feb 14 18:10:05 2014 -0800

----------------------------------------------------------------------
 .../agent/api/SetupGuestNetworkAnswer.java      | 26 ---------------
 .../virtualnetwork/VirtualRoutingResource.java  | 12 +++----
 .../cloud/agent/manager/MockNetworkManager.java |  3 +-
 .../agent/manager/MockNetworkManagerImpl.java   |  9 +++---
 .../VpcVirtualNetworkApplianceManagerImpl.java  | 33 +++++++++-----------
 5 files changed, 25 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6bde675f/core/src/com/cloud/agent/api/SetupGuestNetworkAnswer.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/SetupGuestNetworkAnswer.java b/core/src/com/cloud/agent/api/SetupGuestNetworkAnswer.java
deleted file mode 100644
index 16eb771..0000000
--- a/core/src/com/cloud/agent/api/SetupGuestNetworkAnswer.java
+++ /dev/null
@@ -1,26 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.agent.api;
-
-public class SetupGuestNetworkAnswer extends Answer {
-    public SetupGuestNetworkAnswer() {
-    }
-
-    public SetupGuestNetworkAnswer(SetupGuestNetworkCommand cmd, boolean success, String
result) {
-        super(cmd, success, result);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6bde675f/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 0b90cc9..a287ada 100755
--- a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
+++ b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
@@ -25,7 +25,6 @@ import com.cloud.agent.api.CheckS2SVpnConnectionsCommand;
 import com.cloud.agent.api.Command;
 import com.cloud.agent.api.GetDomRVersionAnswer;
 import com.cloud.agent.api.GetDomRVersionCmd;
-import com.cloud.agent.api.SetupGuestNetworkAnswer;
 import com.cloud.agent.api.SetupGuestNetworkCommand;
 import com.cloud.agent.api.routing.CreateIpAliasCommand;
 import com.cloud.agent.api.routing.DeleteIpAliasCommand;
@@ -47,7 +46,6 @@ import com.cloud.agent.api.routing.SetNetworkACLCommand;
 import com.cloud.agent.api.routing.SetPortForwardingRulesAnswer;
 import com.cloud.agent.api.routing.SetPortForwardingRulesCommand;
 import com.cloud.agent.api.routing.SetPortForwardingRulesVpcCommand;
-import com.cloud.agent.api.routing.SetSourceNatAnswer;
 import com.cloud.agent.api.routing.SetSourceNatCommand;
 import com.cloud.agent.api.routing.SetStaticNatRulesAnswer;
 import com.cloud.agent.api.routing.SetStaticNatRulesCommand;
@@ -631,7 +629,7 @@ public class VirtualRoutingResource {
         return new Answer(cmd);
     }
 
-    protected SetupGuestNetworkAnswer execute(SetupGuestNetworkCommand cmd) {
+    protected Answer execute(SetupGuestNetworkCommand cmd) {
         NicTO nic = cmd.getNic();
         String routerIP = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
         String routerGIP = cmd.getAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP);
@@ -668,9 +666,9 @@ public class VirtualRoutingResource {
         ExecutionResult result = _vrDeployer.executeInVR(routerIP, "vpc_guestnw.sh", args);
 
         if (!result.isSuccess()) {
-            return new SetupGuestNetworkAnswer(cmd, false, "Creating guest network failed
due to " + result.getDetails());
+            return new Answer(cmd, false, "Creating guest network failed due to " + result.getDetails());
         }
-        return new SetupGuestNetworkAnswer(cmd, true, "success");
+        return new Answer(cmd, true, "success");
     }
 
     private SetNetworkACLAnswer execute(SetNetworkACLCommand cmd) {
@@ -720,7 +718,7 @@ public class VirtualRoutingResource {
         }
     }
 
-    protected SetSourceNatAnswer execute(SetSourceNatCommand cmd) {
+    protected Answer execute(SetSourceNatCommand cmd) {
         String routerIP = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
         IpAddressTO pubIP = cmd.getIpAddress();
         String dev = "eth" + pubIP.getNicDevId();
@@ -730,7 +728,7 @@ public class VirtualRoutingResource {
         args += " -c ";
         args += dev;
         ExecutionResult result = _vrDeployer.executeInVR(routerIP, "vpc_snat.sh", args);
-        return new SetSourceNatAnswer(cmd, result.isSuccess(), result.getDetails());
+        return new Answer(cmd, result.isSuccess(), result.getDetails());
     }
 
     private SetPortForwardingRulesAnswer execute(SetPortForwardingRulesVpcCommand cmd) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6bde675f/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManager.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManager.java
b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManager.java
index 554af68..e7a7a95 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManager.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManager.java
@@ -25,7 +25,6 @@ import com.cloud.agent.api.NetworkUsageCommand;
 import com.cloud.agent.api.PlugNicAnswer;
 import com.cloud.agent.api.PlugNicCommand;
 import com.cloud.agent.api.PvlanSetupCommand;
-import com.cloud.agent.api.SetupGuestNetworkAnswer;
 import com.cloud.agent.api.SetupGuestNetworkCommand;
 import com.cloud.agent.api.UnPlugNicAnswer;
 import com.cloud.agent.api.UnPlugNicCommand;
@@ -79,7 +78,7 @@ public interface MockNetworkManager extends Manager {
 
     SetPortForwardingRulesAnswer setVpcPortForwards(SetPortForwardingRulesVpcCommand cmd);
 
-    SetupGuestNetworkAnswer setUpGuestNetwork(SetupGuestNetworkCommand cmd);
+    Answer setUpGuestNetwork(SetupGuestNetworkCommand cmd);
 
     SetStaticNatRulesAnswer setVPCStaticNatRules(SetStaticNatRulesCommand cmd);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6bde675f/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManagerImpl.java
b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManagerImpl.java
index a4ffd95..c76ef4d 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockNetworkManagerImpl.java
@@ -30,7 +30,6 @@ import com.cloud.agent.api.NetworkUsageCommand;
 import com.cloud.agent.api.PlugNicAnswer;
 import com.cloud.agent.api.PlugNicCommand;
 import com.cloud.agent.api.PvlanSetupCommand;
-import com.cloud.agent.api.SetupGuestNetworkAnswer;
 import com.cloud.agent.api.SetupGuestNetworkCommand;
 import com.cloud.agent.api.UnPlugNicAnswer;
 import com.cloud.agent.api.UnPlugNicCommand;
@@ -203,18 +202,18 @@ public class MockNetworkManagerImpl extends ManagerBase implements MockNetworkMa
     }
 
     @Override
-    public SetupGuestNetworkAnswer setUpGuestNetwork(SetupGuestNetworkCommand cmd) {
+    public Answer setUpGuestNetwork(SetupGuestNetworkCommand cmd) {
         String domrName = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
         try {
             MockVMVO vms = _mockVmDao.findByVmName(domrName);
             if (vms == null) {
-                return new SetupGuestNetworkAnswer(cmd, false, "Can not find VM " + domrName);
+                return new Answer(cmd, false, "Can not find VM " + domrName);
             }
-            return new SetupGuestNetworkAnswer(cmd, true, "success");
+            return new Answer(cmd, true, "success");
         } catch (Exception e) {
             String msg = "Creating guest network failed due to " + e.toString();
             s_logger.warn(msg, e);
-            return new SetupGuestNetworkAnswer(cmd, false, msg);
+            return new Answer(cmd, false, msg);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6bde675f/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
index 6e4b771..2b798bf 100644
--- a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
@@ -16,27 +16,10 @@
 // under the License.
 package com.cloud.network.router;
 
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeSet;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.Command;
 import com.cloud.agent.api.NetworkUsageCommand;
 import com.cloud.agent.api.PlugNicCommand;
-import com.cloud.agent.api.SetupGuestNetworkAnswer;
 import com.cloud.agent.api.SetupGuestNetworkCommand;
 import com.cloud.agent.api.routing.IpAssocVpcCommand;
 import com.cloud.agent.api.routing.NetworkElementCommand;
@@ -126,6 +109,20 @@ import com.cloud.vm.VirtualMachine.State;
 import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.VirtualMachineProfile.Param;
 import com.cloud.vm.dao.VMInstanceDao;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeSet;
 
 @Component
 @Local(value = {VpcVirtualNetworkApplianceManager.class, VpcVirtualNetworkApplianceService.class})
@@ -339,7 +336,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
             cmds.addCommand("setupguestnetwork", setupCmd);
             sendCommandsToRouter(router, cmds);
 
-            SetupGuestNetworkAnswer setupAnswer = cmds.getAnswer(SetupGuestNetworkAnswer.class);
+            Answer setupAnswer = cmds.getAnswer("setupguestnetwork");
             String setup = add ? "set" : "destroy";
             if (!(setupAnswer != null && setupAnswer.getResult())) {
                 s_logger.warn("Unable to " + setup + " guest network on router " + router);


Mime
View raw message