Repository: cloudstack
Updated Branches:
  refs/heads/4.4 37bd82aa1 -> 410413606


CLOUDSTACK-6528 SetupGuestNetwork command is not deleting the guest network 
configured on the eth device


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

Branch: refs/heads/4.4
Commit: 0d99fc38f53786d912365eba9bfaa9a832fc1159
Parents: 37bd82a
Author: Rajesh Battala <rajesh.batt...@citrix.com>
Authored: Mon Apr 28 16:27:15 2014 +0530
Committer: Daan Hoogland <d...@onecht.net>
Committed: Mon May 5 11:17:48 2014 +0200

----------------------------------------------------------------------
 .../resource/virtualnetwork/VirtualRoutingResource.java   | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0d99fc38/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 0a7aa26..a8986a3 100755
--- 
a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
+++ 
b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
@@ -780,8 +780,14 @@ public class VirtualRoutingResource {
 
         String dev = "eth" + nic.getDeviceId();
         String netmask = NetUtils.getSubNet(routerGIP, nic.getNetmask());
-
-        String args = " -C";
+        String args = "";
+        if(cmd.isAdd() == false) {
+            //pass the argument to script to delete the network
+            args +=" -D ";
+        } else {
+            // pass create option argument if the ip needs to be added to eth 
device
+            args +=" -C ";
+        }
         args += " -M " + nic.getMac();
         args += " -d " + dev;
         args += " -i " + routerGIP;

Reply via email to