From 581d7fe9b5fa93366481f1228ad87619131aa3d8 Mon Sep 17 00:00:00 2001 From: Alejandro Huertas Herrero Date: Wed, 5 Dec 2018 13:11:26 +0100 Subject: [PATCH] F #911: Fix bug when detaching a non external alias. (#2682) --- src/vmm_mad/exec/one_vmm_exec.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 1735539802..256f93fecc 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -1012,6 +1012,7 @@ class ExecDriver < VirtualMachineDriver # DETACHNIC action to detach a nic interface # def detach_nic(id, drv_message) + action = ACTION[:detach_nic] xml_data = decode(drv_message) nic_alias = false @@ -1035,8 +1036,6 @@ class ExecDriver < VirtualMachineDriver return end - action = VmmAction.new(self, id, :detach_nic, drv_message) - if !nic_alias steps=[ # Detach the NIC @@ -1063,7 +1062,13 @@ class ExecDriver < VirtualMachineDriver steps = [] end - action.run(steps) + if steps.empty? + send_message(action, RESULT[:success], id, "") + else + action = VmmAction.new(self, id, :detach_nic, drv_message) + + action.run(steps) + end end #