Skip to content

Commit 6cbb9a5

Browse files
CLOUDSTACK-6528 SetupGuestNetwork command is not deleting the guest network configured on the eth device
1 parent 14f1b96 commit 6cbb9a5

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,8 +780,14 @@ protected List<ConfigItem> generateConfig(SetupGuestNetworkCommand cmd) {
780780

781781
String dev = "eth" + nic.getDeviceId();
782782
String netmask = NetUtils.getSubNet(routerGIP, nic.getNetmask());
783-
784-
String args = " -C";
783+
String args = "";
784+
if(cmd.isAdd() == false) {
785+
//pass the argument to script to delete the network
786+
args +=" -D ";
787+
} else {
788+
// pass create option argument if the ip needs to be added to eth device
789+
args +=" -C ";
790+
}
785791
args += " -M " + nic.getMac();
786792
args += " -d " + dev;
787793
args += " -i " + routerGIP;

0 commit comments

Comments
 (0)