From: Sean Smith Date: Mon, 8 Mar 2021 21:21:56 +0000 (-0500) Subject: Release VLAN on booking end X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F47%2F72147%2F1;p=laas.git Release VLAN on booking end Signed-off-by: Sean Smith Change-Id: Ib17fd871501a2af46bb78bbdfc68112a66e763c0 --- diff --git a/src/dashboard/tasks.py b/src/dashboard/tasks.py index fec8384..3f88449 100644 --- a/src/dashboard/tasks.py +++ b/src/dashboard/tasks.py @@ -83,6 +83,7 @@ def free_hosts(): job__complete=True, resource__isnull=False ) + for booking in bookings: ResourceManager.getInstance().releaseResourceBundle(booking.resource) diff --git a/src/resource_inventory/resource_manager.py b/src/resource_inventory/resource_manager.py index f587a82..9406977 100644 --- a/src/resource_inventory/resource_manager.py +++ b/src/resource_inventory/resource_manager.py @@ -67,8 +67,7 @@ class ResourceManager: raise NotImplementedError("Resource Bundle Deletion Not Implemented") def releaseResourceBundle(self, resourceBundle): - for resource in resourceBundle.get_resources(): - resource.release() + resourceBundle.release() def get_vlans(self, resourceTemplate): networks = {}