From 0c71a0ce238a1ca816cec35b62e228a97102aa6a Mon Sep 17 00:00:00 2001 From: Sawyer Bergeron Date: Fri, 7 Aug 2020 14:49:11 -0400 Subject: Fix vlan deallocation and ownership Change-Id: I74bd2d062611ba1ca997cfb50a91d2396e70526b Signed-off-by: Sawyer Bergeron --- src/resource_inventory/resource_manager.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/resource_inventory/resource_manager.py') diff --git a/src/resource_inventory/resource_manager.py b/src/resource_inventory/resource_manager.py index 9300040..81f4747 100644 --- a/src/resource_inventory/resource_manager.py +++ b/src/resource_inventory/resource_manager.py @@ -102,7 +102,7 @@ class ResourceManager: phys_res.config = config resources.append(phys_res) - self.configureNetworking(phys_res, vlan_map) + self.configureNetworking(resource_bundle, phys_res, vlan_map) phys_res.save() except Exception as e: @@ -111,7 +111,7 @@ class ResourceManager: return resource_bundle - def configureNetworking(self, resource, vlan_map): + def configureNetworking(self, resource_bundle, resource, vlan_map): for physical_interface in resource.interfaces.all(): # assign interface configs @@ -128,7 +128,8 @@ class ResourceManager: for connection in iface_config.connections.all(): physicalNetwork = PhysicalNetwork.objects.create( vlan_id=vlan_map[connection.network.name], - generic_network=connection.network + generic_network=connection.network, + bundle=resource_bundle, ) physical_interface.config.add( Vlan.objects.create( -- cgit 1.2.3-korg