From 3b5d16d137a4f37fd5bf70864a31f1a2612697f3 Mon Sep 17 00:00:00 2001 From: Sachin Bansal Date: Fri, 11 Sep 2015 13:32:50 -0700 Subject: [PATCH] Handle deletion of vmi correctly in schema transformer Currently, schema transformer only deletes VMi from its internal database when link to VM goes away. This causes problems for VMIs which are not attached to any VMI (e.g. VMI created for TOR). As a result, when another VMI with same name is created, schema transformer does not link it to the default RI. With this change, if the link to its parent goes away, we will delete the VMI locally. Change-Id: Ic17a31f67a3ca7ee6d7c136bf1d348224f561646 Closes-Bug: 1477371 (cherry picked from commit f78e7047e619abf4fdc2acae626b6ff6f5e24d3c) --- src/config/schema-transformer/to_bgp.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/config/schema-transformer/to_bgp.py b/src/config/schema-transformer/to_bgp.py index 86dffa95cc9..9435ce212b1 100644 --- a/src/config/schema-transformer/to_bgp.py +++ b/src/config/schema-transformer/to_bgp.py @@ -3116,6 +3116,11 @@ def delete_virtual_machine_interface_virtual_machine(self, idents, meta): vm.delete_interface(vmi_name) # end delete_virtual_machine_interface_virtual_machine + def delete_project_virtual_machine_interface(self, idents, meta): + vmi_name = idents['virtual-machine-interface'] + VirtualMachineInterfaceST.delete(vmi_name) + # end delete_project_virtual_machine_interface + def add_virtual_machine_service_instance(self, idents, meta): vm_name = idents['virtual-machine'] si_name = idents['service-instance']