From 6cbb9a5b722bbb5a0ab74024cf00a99fbc8ef2ec Mon Sep 17 00:00:00 2001 From: Rajesh Battala Date: Mon, 28 Apr 2014 16:27:15 +0530 Subject: [PATCH] CLOUDSTACK-6528 SetupGuestNetwork command is not deleting the guest network configured on the eth device --- .../virtualnetwork/VirtualRoutingResource.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java index 0a7aa26cdc5..a8986a3d052 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;